diff options
author | Reinier Zwitserloot <reinier@tipit.to> | 2009-08-27 23:05:14 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@tipit.to> | 2009-08-27 23:05:14 +0200 |
commit | fe0da3f53f1e88b704e21463cc5fea3d998e394a (patch) | |
tree | fa97c0d94a562dd7dd862a5d8e6e2f1ac432d060 /src/lombok/javac/handlers/HandleSetter.java | |
parent | e6bb460e2b1ba49698e5306ddcb5ce38748e2dfc (diff) | |
download | lombok-fe0da3f53f1e88b704e21463cc5fea3d998e394a.tar.gz lombok-fe0da3f53f1e88b704e21463cc5fea3d998e394a.tar.bz2 lombok-fe0da3f53f1e88b704e21463cc5fea3d998e394a.zip |
Now @Nullable is also copied over.
Diffstat (limited to 'src/lombok/javac/handlers/HandleSetter.java')
-rw-r--r-- | src/lombok/javac/handlers/HandleSetter.java | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/lombok/javac/handlers/HandleSetter.java b/src/lombok/javac/handlers/HandleSetter.java index 9fb995e4..c10e731c 100644 --- a/src/lombok/javac/handlers/HandleSetter.java +++ b/src/lombok/javac/handlers/HandleSetter.java @@ -21,12 +21,7 @@ */ package lombok.javac.handlers; -import static lombok.javac.handlers.PKG.findNonNullAnnotations; -import static lombok.javac.handlers.PKG.generateNullCheck; -import static lombok.javac.handlers.PKG.injectMethod; -import static lombok.javac.handlers.PKG.methodExists; -import static lombok.javac.handlers.PKG.toJavacModifier; -import static lombok.javac.handlers.PKG.toSetterName; +import static lombok.javac.handlers.PKG.*; import lombok.AccessLevel; import lombok.Setter; import lombok.core.AnnotationValues; @@ -125,7 +120,8 @@ public class HandleSetter implements JavacAnnotationHandler<Setter> { JCAssign assign = treeMaker.Assign(thisX, treeMaker.Ident(fieldDecl.name)); List<JCStatement> statements; - List<JCAnnotation> nonNulls = findNonNullAnnotations(field); + List<JCAnnotation> nonNulls = findAnnotations(field, NON_NULL_PATTERN); + List<JCAnnotation> nullables = findAnnotations(field, NULLABLE_PATTERN); if (nonNulls.isEmpty()) { statements = List.<JCStatement>of(treeMaker.Exec(assign)); } @@ -136,7 +132,7 @@ public class HandleSetter implements JavacAnnotationHandler<Setter> { JCBlock methodBody = treeMaker.Block(0, statements); Name methodName = field.toName(toSetterName(fieldDecl)); - JCVariableDecl param = treeMaker.VarDef(treeMaker.Modifiers(0, nonNulls), fieldDecl.name, fieldDecl.vartype, null); + JCVariableDecl param = treeMaker.VarDef(treeMaker.Modifiers(0, nonNulls.appendList(nullables)), fieldDecl.name, fieldDecl.vartype, null); JCExpression methodType = treeMaker.Type(field.getSymbolTable().voidType); List<JCTypeParameter> methodGenericParams = List.nil(); |