aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/javac/apt
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/lombok/javac/apt')
-rw-r--r--src/core/lombok/javac/apt/Processor.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/core/lombok/javac/apt/Processor.java b/src/core/lombok/javac/apt/Processor.java
index ce4d75ff..783cf6b4 100644
--- a/src/core/lombok/javac/apt/Processor.java
+++ b/src/core/lombok/javac/apt/Processor.java
@@ -28,13 +28,14 @@ import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.net.URL;
import java.util.ArrayList;
+import java.util.Comparator;
import java.util.Enumeration;
import java.util.HashSet;
-import java.util.IdentityHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.SortedSet;
+import java.util.TreeMap;
import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.Messager;
@@ -217,7 +218,17 @@ public class Processor extends AbstractProcessor {
}
}
- private final IdentityHashMap<JCCompilationUnit, Long> roots = new IdentityHashMap<JCCompilationUnit, Long>();
+ // DEBUG - We just blithely assume that there's always a sourcefile.getName() component, and that the performance impact of this is not relevant.
+ // - ... but mostly the 'just blithely assume there's a sourcefile' part means we shouldn't just roll this out.
+ private final Map<JCCompilationUnit,Long> roots = new TreeMap<JCCompilationUnit, Long>(new Comparator<JCCompilationUnit>() {
+ @Override public int compare(JCCompilationUnit o1, JCCompilationUnit o2) {
+ if (o1 == o2) return 0;
+
+ int c = o1.sourcefile.getName().compareTo(o2.sourcefile.getName());
+ if (c != 0) return c;
+ return System.identityHashCode(o1) < System.identityHashCode(o2) ? -1 : +1;
+ }
+ });
private long[] priorityLevels;
private Set<Long> priorityLevelsRequiringResolutionReset;