--- old/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/ClassDefinitionBlockFactory.java 2016-05-12 04:24:20.558334643 +0300 +++ new/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/ClassDefinitionBlockFactory.java 2016-05-12 04:24:20.478334644 +0300 @@ -38,7 +38,7 @@ import jdk.test.lib.jittester.types.TypeKlass; import jdk.test.lib.jittester.utils.PseudoRandom; -class ClassDefinitionBlockFactory extends Factory { +class ClassDefinitionBlockFactory extends Factory { private final String prefix; private final long complexityLimit; private final int classesLimit; @@ -62,7 +62,7 @@ } @Override - public IRNode produce() throws ProductionFailedException { + public ClassDefinitionBlock produce() throws ProductionFailedException { ArrayList content = new ArrayList<>(); int limit = (int) Math.ceil(PseudoRandom.random() * classesLimit); if (limit > 0) { @@ -74,9 +74,8 @@ .setComplexityLimit(classCompl); for (int i = 0; i < limit; i++) { try { - Rule rule = new Rule("class"); + Rule rule = new Rule<>("class"); rule.add("basic_class", builder.setName(prefix + "_Class_" + i) - .setPrinterName(prefix + ".Printer") .setMemberFunctionsLimit(memberFunctionsLimit) .getKlassFactory()); if (!ProductionParams.disableInterfaces.value()) { @@ -110,13 +109,12 @@ IRNode randomChild = childs.get(0); List leaves = randomChild.getStackableLeaves(); if (!leaves.isEmpty()) { - PseudoRandom.shuffle(leaves); - Block randomLeaf = (Block) leaves.get(0); - TypeKlass klass = (TypeKlass) randomChild.getKlass(); + Block randomLeaf = (Block) leaves.get(PseudoRandom.randomNotNegative(leaves.size())); + TypeKlass owner = randomChild.getOwner(); int newLevel = randomLeaf.getLevel() + 1; - Type retType = randomLeaf.getReturnType(); + Type retType = randomLeaf.getResultType(); IRNodeBuilder b = new IRNodeBuilder() - .setOwnerKlass(klass) + .setOwnerKlass(owner) .setResultType(retType) .setComplexityLimit(complexityLimit) .setStatementLimit(statementLimit) @@ -137,7 +135,7 @@ .filter(c -> c instanceof Klass && c.countDepth() > maxDepth) .collect(Collectors.toList()); for (IRNode ch : childs) { - List leaves = null; + List leaves; do { long depth = Math.max(ch.countDepth(), maxDepth + 1); leaves = ch.getDeviantBlocks(depth);