diff options
author | Jacob Middag <jacob@gaddim.nl> | 2019-08-08 21:14:58 +0200 |
---|---|---|
committer | Jacob Middag <jacob@gaddim.nl> | 2019-08-08 21:14:58 +0200 |
commit | 819d1956761f6077fdf897e77c4f6ac47e92104e (patch) | |
tree | 9dcde5edd2c5fc7d17c83b97ad46fda28c5964d1 /src/core/lombok/javac/handlers/HandleSetter.java | |
parent | ff1c01d9e9e66d898c30939b497490b04fe6163c (diff) | |
download | lombok-819d1956761f6077fdf897e77c4f6ac47e92104e.tar.gz lombok-819d1956761f6077fdf897e77c4f6ac47e92104e.tar.bz2 lombok-819d1956761f6077fdf897e77c4f6ac47e92104e.zip |
[Fixes #2189] Clone type to correctly set annotated type on constructor, getter and setter.
Diffstat (limited to 'src/core/lombok/javac/handlers/HandleSetter.java')
-rw-r--r-- | src/core/lombok/javac/handlers/HandleSetter.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/lombok/javac/handlers/HandleSetter.java b/src/core/lombok/javac/handlers/HandleSetter.java index cd8b5d1c..560069ff 100644 --- a/src/core/lombok/javac/handlers/HandleSetter.java +++ b/src/core/lombok/javac/handlers/HandleSetter.java @@ -233,7 +233,8 @@ public class HandleSetter extends JavacAnnotationHandler<Setter> { List<JCAnnotation> annsOnParam = copyAnnotations(onParam).appendList(copyableAnnotations); long flags = JavacHandlerUtil.addFinalIfNeeded(Flags.PARAMETER, field.getContext()); - JCVariableDecl param = treeMaker.VarDef(treeMaker.Modifiers(flags, annsOnParam), paramName, fieldDecl.vartype, null); + JCExpression pType = cloneType(treeMaker, fieldDecl.vartype, source.get(), source.getContext()); + JCVariableDecl param = treeMaker.VarDef(treeMaker.Modifiers(flags, annsOnParam), paramName, pType, null); if (!hasNonNullAnnotations(field) && !hasNonNullAnnotations(field, onParam)) { statements.append(treeMaker.Exec(assign)); |