diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2018-09-11 01:41:22 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2018-09-11 01:59:19 +0200 |
commit | d7873f2d21564e8e7f22409fe03681d7dd4c8c1e (patch) | |
tree | 582ac7cf6ef36c69e93503a04b8391950df25f24 /src/core/lombok/javac/handlers/HandleBuilder.java | |
parent | cc8370ab2d7b3ca15023364c99e53735e62e13d7 (diff) | |
download | lombok-d7873f2d21564e8e7f22409fe03681d7dd4c8c1e.tar.gz lombok-d7873f2d21564e8e7f22409fe03681d7dd4c8c1e.tar.bz2 lombok-d7873f2d21564e8e7f22409fe03681d7dd4c8c1e.zip |
Replaced the notion of ‘nullable’ and ‘nonnull’ get copied to ‘any ‘copyable’ annotations get copied’, with ‘copyable’ defined as a specific FQN-style list of well-known nullity-indicating annotations, plus whatever you configured in lombok.config.
Also some work on the notion of TYPE_USE annotations.
Diffstat (limited to 'src/core/lombok/javac/handlers/HandleBuilder.java')
-rw-r--r-- | src/core/lombok/javac/handlers/HandleBuilder.java | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/core/lombok/javac/handlers/HandleBuilder.java b/src/core/lombok/javac/handlers/HandleBuilder.java index 7577eeb2..8170898b 100644 --- a/src/core/lombok/javac/handlers/HandleBuilder.java +++ b/src/core/lombok/javac/handlers/HandleBuilder.java @@ -150,14 +150,10 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> { JavacNode isDefault = findAnnotation(Builder.Default.class, fieldNode, false); boolean isFinal = (fd.mods.flags & Flags.FINAL) != 0 || (valuePresent && !hasAnnotation(NonFinal.class, fieldNode)); - List<JCAnnotation> nonNulls = findAnnotations(fieldNode, NON_NULL_PATTERN); - List<JCAnnotation> nullables = findAnnotations(fieldNode, NULLABLE_PATTERN); - List<JCAnnotation> copyableAnnotations = findExactAnnotations(fieldNode, getCopyableAnnotationNames(fieldNode.getAst())); - BuilderFieldData bfd = new BuilderFieldData(); bfd.rawName = fd.name; bfd.name = removePrefixFromField(fieldNode); - bfd.annotations = nonNulls.appendList(nullables).appendList(copyableAnnotations); + bfd.annotations = findCopyableAnnotations(fieldNode); bfd.type = fd.vartype; bfd.singularData = getSingularData(fieldNode); bfd.originalFieldNode = fieldNode; @@ -334,14 +330,10 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> { if (param.getKind() != Kind.ARGUMENT) continue; BuilderFieldData bfd = new BuilderFieldData(); - List<JCAnnotation> nonNulls = findAnnotations(param, NON_NULL_PATTERN); - List<JCAnnotation> nullables = findAnnotations(param, NULLABLE_PATTERN); - List<JCAnnotation> copyableAnnotations = findExactAnnotations(param, getCopyableAnnotationNames(param.getAst())); - JCVariableDecl raw = (JCVariableDecl) param.get(); bfd.name = raw.name; bfd.rawName = raw.name; - bfd.annotations = nonNulls.appendList(nullables).appendList(copyableAnnotations); + bfd.annotations = findCopyableAnnotations(param); bfd.type = raw.vartype; bfd.singularData = getSingularData(param); bfd.originalFieldNode = param; |