diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2010-12-31 10:41:53 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2010-12-31 10:41:53 +0100 |
commit | fb1d6c0f0dfafcd889cac8906246803349c353f2 (patch) | |
tree | c9941901b4df1c01e3a96245845df89d7cb982ed /src/core/lombok/eclipse | |
parent | 59e2a0ff1d347bb1a7d02b7ac37b1f9d38647e60 (diff) | |
download | lombok-fb1d6c0f0dfafcd889cac8906246803349c353f2.tar.gz lombok-fb1d6c0f0dfafcd889cac8906246803349c353f2.tar.bz2 lombok-fb1d6c0f0dfafcd889cac8906246803349c353f2.zip |
Resolve-phase transformers in eclipse need to force a rebuild of the EclipseAST object.
Fixes issue #171
Diffstat (limited to 'src/core/lombok/eclipse')
-rw-r--r-- | src/core/lombok/eclipse/EclipseAST.java | 6 | ||||
-rw-r--r-- | src/core/lombok/eclipse/TransformEclipseAST.java | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/core/lombok/eclipse/EclipseAST.java b/src/core/lombok/eclipse/EclipseAST.java index 1af9bc73..6915fcb4 100644 --- a/src/core/lombok/eclipse/EclipseAST.java +++ b/src/core/lombok/eclipse/EclipseAST.java @@ -196,12 +196,12 @@ public class EclipseAST extends AST<EclipseAST, EclipseNode, ASTNode> { * with filled in method bodies and such. Also propagates problems and errors, which in diet parse * mode can't be reliably added to the problems/warnings view. */ - public void reparse() { + public void reparse(boolean forceRebuild) { propagateProblems(); - if (completeParse) return; + if (completeParse && !forceRebuild) return; boolean changed = isChanged(); boolean newCompleteParse = isComplete(compilationUnitDeclaration); - if (!newCompleteParse) return; + if (!newCompleteParse && !forceRebuild) return; top().rebuild(); diff --git a/src/core/lombok/eclipse/TransformEclipseAST.java b/src/core/lombok/eclipse/TransformEclipseAST.java index 1f31bd59..443969f8 100644 --- a/src/core/lombok/eclipse/TransformEclipseAST.java +++ b/src/core/lombok/eclipse/TransformEclipseAST.java @@ -84,7 +84,7 @@ public class TransformEclipseAST { transform(parser, ast); } - public static EclipseAST getAST(CompilationUnitDeclaration ast) { + public static EclipseAST getAST(CompilationUnitDeclaration ast, boolean forceRebuild) { EclipseAST existing = null; if (astCacheField != null) { try { @@ -101,7 +101,7 @@ public class TransformEclipseAST { } catch (Exception ignore) { } } else { - existing.reparse(); + existing.reparse(forceRebuild); } return existing; @@ -126,7 +126,7 @@ public class TransformEclipseAST { // Do NOT abort if (ast.bits & ASTNode.HasAllMethodBodies) != 0 - that doesn't work. try { - EclipseAST existing = getAST(ast); + EclipseAST existing = getAST(ast, false); new TransformEclipseAST(existing).go(); } catch (Throwable t) { try { |