diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2010-11-10 01:27:00 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2010-11-10 01:27:00 +0100 |
commit | 2bc8ad4dfd6e34e15f2bd7a661d62bc26cc13379 (patch) | |
tree | c95c530cc11c1e7925794204ab13d35348e079b1 /src/core/lombok/javac/JavacTransformer.java | |
parent | d02a0f823fb5922ddc2e29e62cc0359be3fce0a8 (diff) | |
download | lombok-2bc8ad4dfd6e34e15f2bd7a661d62bc26cc13379.tar.gz lombok-2bc8ad4dfd6e34e15f2bd7a661d62bc26cc13379.tar.bz2 lombok-2bc8ad4dfd6e34e15f2bd7a661d62bc26cc13379.zip |
'val' now fully works on javac, even when referring to lombok-generated code, by (ab)using the annotation processor's round system. This breaks delombok though. That'll have to be fixed next.
Diffstat (limited to 'src/core/lombok/javac/JavacTransformer.java')
-rw-r--r-- | src/core/lombok/javac/JavacTransformer.java | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/src/core/lombok/javac/JavacTransformer.java b/src/core/lombok/javac/JavacTransformer.java index 5d1e79af..e90f780b 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(Context context, java.util.List<JCCompilationUnit> compilationUnitsRaw) { + public boolean transform(boolean postResolution, Context context, java.util.List<JCCompilationUnit> compilationUnitsRaw) { List<JCCompilationUnit> compilationUnits; if (compilationUnitsRaw instanceof List<?>) { compilationUnits = (List<JCCompilationUnit>)compilationUnitsRaw; @@ -57,22 +57,25 @@ public class JavacTransformer { for (JCCompilationUnit unit : compilationUnits) asts.add(new JavacAST(messager, context, unit)); - handlers.setPreResolutionPhase(); - for (JavacAST ast : asts) { - ast.traverse(new AnnotationVisitor()); - handlers.callASTVisitors(ast); - } - - handlers.setPostResolutionPhase(); - for (JavacAST ast : asts) { - ast.traverse(new AnnotationVisitor()); - handlers.callASTVisitors(ast); + if (!postResolution) { + handlers.setPreResolutionPhase(); + for (JavacAST ast : asts) { + ast.traverse(new AnnotationVisitor()); + handlers.callASTVisitors(ast); + } } - - handlers.setPrintASTPhase(); - for (JavacAST ast : asts) { - ast.traverse(new AnnotationVisitor()); + if (postResolution) { + handlers.setPostResolutionPhase(); + for (JavacAST ast : asts) { + ast.traverse(new AnnotationVisitor()); + handlers.callASTVisitors(ast); + } + + handlers.setPrintASTPhase(); + for (JavacAST ast : asts) { + ast.traverse(new AnnotationVisitor()); + } } for (JavacAST ast : asts) { |