aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2010-12-31 10:41:53 +0100
committerReinier Zwitserloot <reinier@zwitserloot.com>2010-12-31 10:41:53 +0100
commitfb1d6c0f0dfafcd889cac8906246803349c353f2 (patch)
treec9941901b4df1c01e3a96245845df89d7cb982ed /src
parent59e2a0ff1d347bb1a7d02b7ac37b1f9d38647e60 (diff)
downloadlombok-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')
-rw-r--r--src/core/lombok/eclipse/EclipseAST.java6
-rw-r--r--src/core/lombok/eclipse/TransformEclipseAST.java6
-rw-r--r--src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java2
3 files changed, 7 insertions, 7 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 {
diff --git a/src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java b/src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java
index 8c1a8db7..69edae6e 100644
--- a/src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java
+++ b/src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java
@@ -113,7 +113,7 @@ public class PatchDelegate {
if (cud == null) {
cud = scope.compilationUnitScope().referenceContext;
- eclipseAst = TransformEclipseAST.getAST(cud);
+ eclipseAst = TransformEclipseAST.getAST(cud, true);
}
List<ClassLiteralAccess> rawTypes = new ArrayList<ClassLiteralAccess>();