aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/lombok/javac/handlers/HandleBuilderDefaultRemove.java1
-rw-r--r--src/core/lombok/javac/handlers/HandleSuperBuilder.java4
2 files changed, 4 insertions, 1 deletions
diff --git a/src/core/lombok/javac/handlers/HandleBuilderDefaultRemove.java b/src/core/lombok/javac/handlers/HandleBuilderDefaultRemove.java
index d7bc28cb..64360eb2 100644
--- a/src/core/lombok/javac/handlers/HandleBuilderDefaultRemove.java
+++ b/src/core/lombok/javac/handlers/HandleBuilderDefaultRemove.java
@@ -40,5 +40,6 @@ import lombok.spi.Provides;
public class HandleBuilderDefaultRemove extends JavacAnnotationHandler<Builder.Default> {
@Override public void handle(AnnotationValues<Default> annotation, JCAnnotation ast, JavacNode annotationNode) {
deleteAnnotationIfNeccessary(annotationNode, Builder.Default.class);
+ deleteImportFromCompilationUnit(annotationNode, Builder.class.getName());
}
}
diff --git a/src/core/lombok/javac/handlers/HandleSuperBuilder.java b/src/core/lombok/javac/handlers/HandleSuperBuilder.java
index adf3f584..7418ac87 100644
--- a/src/core/lombok/javac/handlers/HandleSuperBuilder.java
+++ b/src/core/lombok/javac/handlers/HandleSuperBuilder.java
@@ -177,7 +177,7 @@ public class HandleSuperBuilder extends JavacAnnotationHandler<SuperBuilder> {
boolean valuePresent = (hasAnnotation(lombok.Value.class, parent) || hasAnnotation("lombok.experimental.Value", parent));
for (JavacNode fieldNode : HandleConstructor.findAllFields(parent, true)) {
JCVariableDecl fd = (JCVariableDecl) fieldNode.get();
- JavacNode isDefault = findAnnotation(Builder.Default.class, fieldNode, true);
+ JavacNode isDefault = findAnnotation(Builder.Default.class, fieldNode, false);
boolean isFinal = (fd.mods.flags & Flags.FINAL) != 0 || (valuePresent && !hasAnnotation(NonFinal.class, fieldNode));
BuilderFieldData bfd = new BuilderFieldData();
bfd.rawName = fd.name;
@@ -190,11 +190,13 @@ public class HandleSuperBuilder extends JavacAnnotationHandler<SuperBuilder> {
if (bfd.singularData != null && isDefault != null) {
isDefault.addError("@Builder.Default and @Singular cannot be mixed.");
+ findAnnotation(Builder.Default.class, fieldNode, true);
isDefault = null;
}
if (fd.init == null && isDefault != null) {
isDefault.addWarning("@Builder.Default requires an initializing expression (' = something;').");
+ findAnnotation(Builder.Default.class, fieldNode, true);
isDefault = null;
}