diff options
Diffstat (limited to 'src/core/lombok/javac')
-rw-r--r-- | src/core/lombok/javac/handlers/HandleExtensionMethod.java | 2 | ||||
-rw-r--r-- | src/core/lombok/javac/handlers/HandleFieldDefaults.java | 2 | ||||
-rw-r--r-- | src/core/lombok/javac/handlers/HandleValue.java | 7 |
3 files changed, 9 insertions, 2 deletions
diff --git a/src/core/lombok/javac/handlers/HandleExtensionMethod.java b/src/core/lombok/javac/handlers/HandleExtensionMethod.java index 68df38ef..717afbc5 100644 --- a/src/core/lombok/javac/handlers/HandleExtensionMethod.java +++ b/src/core/lombok/javac/handlers/HandleExtensionMethod.java @@ -99,7 +99,7 @@ public class HandleExtensionMethod extends JavacAnnotationHandler<ExtensionMetho if (providerType == null) continue; if ((providerType.tsym.flags() & (INTERFACE | ANNOTATION)) != 0) continue; - extensions.add(getExtension(typeNode, (ClassType) providerType)); + extensions.add(getExtension(typeNode, (ClassType) providerType)); } return extensions; } diff --git a/src/core/lombok/javac/handlers/HandleFieldDefaults.java b/src/core/lombok/javac/handlers/HandleFieldDefaults.java index c0829172..d32446c3 100644 --- a/src/core/lombok/javac/handlers/HandleFieldDefaults.java +++ b/src/core/lombok/javac/handlers/HandleFieldDefaults.java @@ -91,6 +91,8 @@ public class HandleFieldDefaults extends JavacAnnotationHandler<FieldDefaults> { field.mods.flags |= Flags.FINAL; } } + + fieldNode.rebuild(); } @Override public void handle(AnnotationValues<FieldDefaults> annotation, JCAnnotation ast, JavacNode annotationNode) { diff --git a/src/core/lombok/javac/handlers/HandleValue.java b/src/core/lombok/javac/handlers/HandleValue.java index b52bad7c..8b0b9568 100644 --- a/src/core/lombok/javac/handlers/HandleValue.java +++ b/src/core/lombok/javac/handlers/HandleValue.java @@ -35,6 +35,7 @@ import org.mangosdk.spi.ProviderFor; import com.sun.tools.javac.code.Flags; import com.sun.tools.javac.tree.JCTree.JCAnnotation; import com.sun.tools.javac.tree.JCTree.JCClassDecl; +import com.sun.tools.javac.tree.JCTree.JCModifiers; /** * Handles the {@code lombok.Value} annotation for javac. @@ -55,7 +56,11 @@ public class HandleValue extends JavacAnnotationHandler<Value> { String staticConstructorName = annotation.getInstance().staticConstructor(); if (!hasAnnotationAndDeleteIfNeccessary(NonFinal.class, typeNode)) { - ((JCClassDecl) typeNode.get()).mods.flags |= Flags.FINAL; + JCModifiers jcm = ((JCClassDecl) typeNode.get()).mods; + if ((jcm.flags & Flags.FINAL) == 0) { + jcm.flags |= Flags.FINAL; + typeNode.rebuild(); + } } new HandleFieldDefaults().generateFieldDefaultsForType(typeNode, annotationNode, AccessLevel.PRIVATE, true, true); |