# HG changeset patch # User Tom Rodriguez # Date 1434050119 25200 # Node ID 6a93800d10f1016a32e4dd9619f1e2a09926973b # Parent 607a5d8069161003afae4f8c411d5c07b87e015f Map from method name to rule should be per type not per annotation processor diff -r 607a5d806916 -r 6a93800d10f1 graal/com.oracle.graal.compiler.match.processor/src/com/oracle/graal/compiler/match/processor/MatchProcessor.java --- a/graal/com.oracle.graal.compiler.match.processor/src/com/oracle/graal/compiler/match/processor/MatchProcessor.java Thu Jun 11 09:51:50 2015 -0700 +++ b/graal/com.oracle.graal.compiler.match.processor/src/com/oracle/graal/compiler/match/processor/MatchProcessor.java Thu Jun 11 12:15:19 2015 -0700 @@ -333,12 +333,6 @@ */ Map knownTypes = new HashMap<>(); - /** - * The mapping between elements with MatchRules and the wrapper class used invoke the code - * generation after the match. - */ - private Map invokers = new LinkedHashMap<>(); - private TypeDescriptor valueType; private TypeMirror matchRulesTypeMirror; @@ -500,7 +494,7 @@ out.println(); // Generate declarations for the wrapper class to invoke the code generation methods. - for (MethodInvokerItem invoker : invokers.values()) { + for (MethodInvokerItem invoker : info.invokers.values()) { StringBuilder args = new StringBuilder(); StringBuilder types = new StringBuilder(); int count = invoker.fields.size(); @@ -646,6 +640,12 @@ public Set positionDeclarations = new LinkedHashSet<>(); /** + * The mapping between elements with MatchRules and the wrapper class used invoke the code + * generation after the match. + */ + Map invokers = new LinkedHashMap<>(); + + /** * The set of packages which must be imported to refer the classes mention in matchRules. */ Set requiredPackages = new HashSet<>(); @@ -919,14 +919,15 @@ } String methodName = method.getSimpleName().toString(); - MethodInvokerItem invoker = invokers.get(methodName); + MethodInvokerItem invoker = info.invokers.get(methodName); if (invoker == null) { invoker = new MethodInvokerItem(methodName, topDeclaringType(method).getSimpleName().toString(), method, actualParameters); - invokers.put(methodName, invoker); + info.invokers.put(methodName, invoker); } else if (invoker.method != method) { // This could be supported but it's easier if they are unique since the names // are used in log output and snippet counters. - errorMessage(method, "Use unique method names for match methods."); + errorMessage(method, "Use unique method names for match methods: %s.%s != %s.%s", method.getReceiverType(), method.getSimpleName(), invoker.method.getReceiverType(), + invoker.method.getSimpleName()); return; }