aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/javac
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2010-11-10 22:19:26 +0100
committerReinier Zwitserloot <reinier@zwitserloot.com>2010-11-10 22:19:26 +0100
commit249566813149f8e6984561d9d2ba4e348974dc1a (patch)
treea6fbc60eb91bc20fa8908a421f58c6bd27281ce2 /src/core/lombok/javac
parent5b5a3713e2436706f80e782ed26479b066205ab4 (diff)
downloadlombok-249566813149f8e6984561d9d2ba4e348974dc1a.tar.gz
lombok-249566813149f8e6984561d9d2ba4e348974dc1a.tar.bz2
lombok-249566813149f8e6984561d9d2ba4e348974dc1a.zip
Delombok has been fixed to work more like a true javac run now. As a result, its now compatible with resolution again (i.e. resolution based transformers are applied correctly when delomboking).
Diffstat (limited to 'src/core/lombok/javac')
-rw-r--r--src/core/lombok/javac/JavacTransformer.java9
-rw-r--r--src/core/lombok/javac/TrackChangedAsts.java10
2 files changed, 14 insertions, 5 deletions
diff --git a/src/core/lombok/javac/JavacTransformer.java b/src/core/lombok/javac/JavacTransformer.java
index e90f780b..f9757894 100644
--- a/src/core/lombok/javac/JavacTransformer.java
+++ b/src/core/lombok/javac/JavacTransformer.java
@@ -42,7 +42,7 @@ public class JavacTransformer {
this.handlers = HandlerLibrary.load(messager);
}
- public boolean transform(boolean postResolution, Context context, java.util.List<JCCompilationUnit> compilationUnitsRaw) {
+ public void transform(boolean postResolution, Context context, java.util.List<JCCompilationUnit> compilationUnitsRaw) {
List<JCCompilationUnit> compilationUnits;
if (compilationUnitsRaw instanceof List<?>) {
compilationUnits = (List<JCCompilationUnit>)compilationUnitsRaw;
@@ -78,11 +78,10 @@ public class JavacTransformer {
}
}
- for (JavacAST ast : asts) {
- if (ast.isChanged()) return true;
+ TrackChangedAsts changes = context.get(TrackChangedAsts.class);
+ if (changes != null) for (JavacAST ast : asts) {
+ if (ast.isChanged()) changes.changed.add((JCCompilationUnit) ast.top().get());
}
-
- return false;
}
private class AnnotationVisitor extends JavacASTAdapter {
diff --git a/src/core/lombok/javac/TrackChangedAsts.java b/src/core/lombok/javac/TrackChangedAsts.java
new file mode 100644
index 00000000..fa6c0f18
--- /dev/null
+++ b/src/core/lombok/javac/TrackChangedAsts.java
@@ -0,0 +1,10 @@
+package lombok.javac;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import com.sun.tools.javac.tree.JCTree.JCCompilationUnit;
+
+public class TrackChangedAsts {
+ public final Set<JCCompilationUnit> changed = new HashSet<JCCompilationUnit>();
+} \ No newline at end of file