From 5f511da0916450edfef1a1254907e5c29ce55dcd Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Mon, 13 Aug 2012 00:12:41 +0200 Subject: 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. --- src/core/lombok/eclipse/handlers/HandleFieldDefaults.java | 2 ++ src/core/lombok/eclipse/handlers/HandleValue.java | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src/core/lombok/eclipse') 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 field.modifiers |= ClassFileConstants.AccFinal; } } + + fieldNode.rebuild(); } public void handle(AnnotationValues 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 { } // 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); -- cgit