--- old/test/testlibrary/jittester/src/jdk/test/lib/jittester/Rule.java 2016-05-12 04:24:04.618334771 +0300 +++ new/test/testlibrary/jittester/src/jdk/test/lib/jittester/Rule.java 2016-05-12 04:24:04.534334772 +0300 @@ -32,27 +32,26 @@ /** * The Rule. A helper to perform production. */ -public class Rule extends Factory implements Comparable { - private String name; +public class Rule extends Factory implements Comparable> { + private final String name; + private final TreeSet variants; private Integer limit = -1; @Override - public int compareTo(Rule rule) { + public int compareTo(Rule rule) { return name.compareTo(rule.name); } - private TreeSet variants; - public Rule(String name) { this.name = name; variants = new TreeSet<>(); } - public void add(String ruleName, Factory factory) { + public void add(String ruleName, Factory factory) { add(ruleName, factory, 1.0); } - public void add(String ruleName, Factory factory, double weight) { + public void add(String ruleName, Factory factory, double weight) { variants.add(new RuleEntry(ruleName, factory, weight)); } @@ -61,7 +60,7 @@ } @Override - public IRNode produce() throws ProductionFailedException { + public T produce() throws ProductionFailedException { if (!variants.isEmpty()) { // Begin production. LinkedList rulesList = new LinkedList<>(variants); @@ -98,19 +97,19 @@ throw new ProductionFailedException(); } - private class RuleEntry extends Factory implements Comparable { + private class RuleEntry extends Factory implements Comparable { private final double weight; - private final Factory factory; + private final Factory factory; private final String name; - private RuleEntry(String name, Factory factory, double weight) { + private RuleEntry(String name, Factory factory, double weight) { this.name = name; this.weight = weight; this.factory = factory; } @Override - public IRNode produce() throws ProductionFailedException { + public T produce() throws ProductionFailedException { return factory.produce(); }