aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/javac/handlers/HandleSetter.java
diff options
context:
space:
mode:
authorJan Rieke <rieke@subshell.com>2018-09-24 16:46:00 +0200
committerJan Rieke <rieke@subshell.com>2018-09-24 16:46:00 +0200
commitb5648976b6501bdf755814d8d8a096c33f6997ec (patch)
treeaafe939cdc6fdda41719deb42f03c77934cb5209 /src/core/lombok/javac/handlers/HandleSetter.java
parentfd4c9d4bff6e75b30a3ee247edafaabc6888a691 (diff)
parentaee4e76d864e01b5d453409e703ad54852fa57bb (diff)
downloadlombok-b5648976b6501bdf755814d8d8a096c33f6997ec.tar.gz
lombok-b5648976b6501bdf755814d8d8a096c33f6997ec.tar.bz2
lombok-b5648976b6501bdf755814d8d8a096c33f6997ec.zip
Merge remote-tracking branch 'upstream/master' into superToBuilder
Diffstat (limited to 'src/core/lombok/javac/handlers/HandleSetter.java')
-rw-r--r--src/core/lombok/javac/handlers/HandleSetter.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/lombok/javac/handlers/HandleSetter.java b/src/core/lombok/javac/handlers/HandleSetter.java
index 0ddaa7d7..28f5318d 100644
--- a/src/core/lombok/javac/handlers/HandleSetter.java
+++ b/src/core/lombok/javac/handlers/HandleSetter.java
@@ -226,16 +226,15 @@ public class HandleSetter extends JavacAnnotationHandler<Setter> {
JCAssign assign = treeMaker.Assign(fieldRef, treeMaker.Ident(fieldDecl.name));
ListBuffer<JCStatement> statements = new ListBuffer<JCStatement>();
- List<JCAnnotation> nonNulls = findAnnotations(field, NON_NULL_PATTERN);
- List<JCAnnotation> nullables = findAnnotations(field, NULLABLE_PATTERN);
+ List<JCAnnotation> copyableAnnotations = findCopyableAnnotations(field);
Name methodName = field.toName(setterName);
- List<JCAnnotation> annsOnParam = copyAnnotations(onParam).appendList(nonNulls).appendList(nullables);
+ List<JCAnnotation> annsOnParam = copyAnnotations(onParam).appendList(copyableAnnotations);
long flags = JavacHandlerUtil.addFinalIfNeeded(Flags.PARAMETER, field.getContext());
JCVariableDecl param = treeMaker.VarDef(treeMaker.Modifiers(flags, annsOnParam), fieldDecl.name, fieldDecl.vartype, null);
- if (nonNulls.isEmpty()) {
+ if (!hasNonNullAnnotations(field)) {
statements.append(treeMaker.Exec(assign));
} else {
JCStatement nullCheck = generateNullCheck(treeMaker, field, source);