aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/eclipse
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2012-08-13 00:12:41 +0200
committerReinier Zwitserloot <reinier@zwitserloot.com>2012-08-13 00:12:41 +0200
commit5f511da0916450edfef1a1254907e5c29ce55dcd (patch)
tree587d341c17ccbfa6c237d7ebfee95a55e7dba173 /src/core/lombok/eclipse
parent6e25b00acec26c770236d347a879a899c5c930db (diff)
downloadlombok-5f511da0916450edfef1a1254907e5c29ce55dcd.tar.gz
lombok-5f511da0916450edfef1a1254907e5c29ce55dcd.tar.bz2
lombok-5f511da0916450edfef1a1254907e5c29ce55dcd.zip
FieldDefaults (and Value) did not call .rebuild() after changing modifiers. This also meant delombok would not emit the changed code if that's all that changed, because it thought nothing changed.
Diffstat (limited to 'src/core/lombok/eclipse')
-rw-r--r--src/core/lombok/eclipse/handlers/HandleFieldDefaults.java2
-rw-r--r--src/core/lombok/eclipse/handlers/HandleValue.java7
2 files changed, 8 insertions, 1 deletions
diff --git a/src/core/lombok/eclipse/handlers/HandleFieldDefaults.java b/src/core/lombok/eclipse/handlers/HandleFieldDefaults.java
index 2cdfdd4d..0cce0f62 100644
--- a/src/core/lombok/eclipse/handlers/HandleFieldDefaults.java
+++ b/src/core/lombok/eclipse/handlers/HandleFieldDefaults.java
@@ -89,6 +89,8 @@ public class HandleFieldDefaults extends EclipseAnnotationHandler<FieldDefaults>
field.modifiers |= ClassFileConstants.AccFinal;
}
}
+
+ fieldNode.rebuild();
}
public void handle(AnnotationValues<FieldDefaults> annotation, Annotation ast, EclipseNode annotationNode) {
diff --git a/src/core/lombok/eclipse/handlers/HandleValue.java b/src/core/lombok/eclipse/handlers/HandleValue.java
index a1eb24ff..612f218b 100644
--- a/src/core/lombok/eclipse/handlers/HandleValue.java
+++ b/src/core/lombok/eclipse/handlers/HandleValue.java
@@ -57,7 +57,12 @@ public class HandleValue extends EclipseAnnotationHandler<Value> {
}
// Make class final.
- if (!hasAnnotation(NonFinal.class, typeNode)) typeDecl.modifiers |= ClassFileConstants.AccFinal;
+ if (!hasAnnotation(NonFinal.class, typeNode)) {
+ if ((typeDecl.modifiers & ClassFileConstants.AccFinal) == 0) {
+ typeDecl.modifiers |= ClassFileConstants.AccFinal;
+ typeNode.rebuild();
+ }
+ }
new HandleFieldDefaults().generateFieldDefaultsForType(typeNode, annotationNode, AccessLevel.PRIVATE, true, true);