aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/javac/handlers/HandleBuilderDefault.java
diff options
context:
space:
mode:
authorJan Rieke <rieke@subshell.com>2018-06-01 13:48:38 +0200
committerJan Rieke <rieke@subshell.com>2018-06-01 15:57:59 +0200
commitd11263a6c60008894213a1b465f2b16be3a03468 (patch)
treecec107359645cae08db71535846839cb86376949 /src/core/lombok/javac/handlers/HandleBuilderDefault.java
parent51c0c40ac422ddd2828bb0ec79e252e85f1511c9 (diff)
downloadlombok-d11263a6c60008894213a1b465f2b16be3a03468.tar.gz
lombok-d11263a6c60008894213a1b465f2b16be3a03468.tar.bz2
lombok-d11263a6c60008894213a1b465f2b16be3a03468.zip
support @Builder.Default
Diffstat (limited to 'src/core/lombok/javac/handlers/HandleBuilderDefault.java')
-rw-r--r--src/core/lombok/javac/handlers/HandleBuilderDefault.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/lombok/javac/handlers/HandleBuilderDefault.java b/src/core/lombok/javac/handlers/HandleBuilderDefault.java
index 4c4ba0e8..af45a620 100644
--- a/src/core/lombok/javac/handlers/HandleBuilderDefault.java
+++ b/src/core/lombok/javac/handlers/HandleBuilderDefault.java
@@ -31,6 +31,7 @@ import lombok.Builder;
import lombok.core.AST.Kind;
import lombok.core.AnnotationValues;
import lombok.core.HandlerPriority;
+import lombok.experimental.SuperBuilder;
import lombok.javac.JavacAnnotationHandler;
import lombok.javac.JavacNode;
@@ -41,8 +42,9 @@ public class HandleBuilderDefault extends JavacAnnotationHandler<Builder.Default
JavacNode annotatedField = annotationNode.up();
if (annotatedField.getKind() != Kind.FIELD) return;
JavacNode classWithAnnotatedField = annotatedField.up();
- if (!hasAnnotation(Builder.class, classWithAnnotatedField) && !hasAnnotation("lombok.experimental.Builder", classWithAnnotatedField)) {
- annotationNode.addWarning("@Builder.Default requires @Builder on the class for it to mean anything.");
+ if (!hasAnnotation(Builder.class, classWithAnnotatedField) && !hasAnnotation("lombok.experimental.Builder", classWithAnnotatedField)
+ && !hasAnnotation(SuperBuilder.class, classWithAnnotatedField)) {
+ annotationNode.addWarning("@Builder.Default requires @Builder or @SuperBuilder on the class for it to mean anything.");
deleteAnnotationIfNeccessary(annotationNode, Builder.Default.class);
}
}