From 79bfcc4f7ae4bcd61f7f942bfefb940c77927b71 Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Mon, 27 Aug 2018 18:36:13 -0400 Subject: Add configuration key, handle whereever NULLABLE is handled, support Eclipse. --- src/core/lombok/javac/handlers/HandleBuilder.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/core/lombok/javac/handlers/HandleBuilder.java') diff --git a/src/core/lombok/javac/handlers/HandleBuilder.java b/src/core/lombok/javac/handlers/HandleBuilder.java index 335dee1a..75bfb01c 100644 --- a/src/core/lombok/javac/handlers/HandleBuilder.java +++ b/src/core/lombok/javac/handlers/HandleBuilder.java @@ -149,10 +149,15 @@ public class HandleBuilder extends JavacAnnotationHandler { JCVariableDecl fd = (JCVariableDecl) fieldNode.get(); JavacNode isDefault = findAnnotation(Builder.Default.class, fieldNode, false); boolean isFinal = (fd.mods.flags & Flags.FINAL) != 0 || (valuePresent && !hasAnnotation(NonFinal.class, fieldNode)); + + List nonNulls = findAnnotations(fieldNode, NON_NULL_PATTERN); + List nullables = findAnnotations(fieldNode, NULLABLE_PATTERN); + List copyAnnotations = findExactAnnotations(fieldNode, copyAnnotationNames(fieldNode.getAst())); + BuilderFieldData bfd = new BuilderFieldData(); bfd.rawName = fd.name; bfd.name = removePrefixFromField(fieldNode); - bfd.annotations = fd.mods.annotations; + bfd.annotations = nonNulls.appendList(nullables).appendList(copyAnnotations); bfd.type = fd.vartype; bfd.singularData = getSingularData(fieldNode); bfd.originalFieldNode = fieldNode; -- cgit