diff options
author | Jacob Middag <jacob@gaddim.nl> | 2020-05-15 12:31:36 +0200 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2020-06-11 21:16:38 +0200 |
commit | 51216bed0e723598fa26677ffc3ea0c8d2c3150d (patch) | |
tree | 14c97a86f0c309832854751888b76a97c58ad299 | |
parent | a8c75a64f4a8dbd0651021ebbc6197269f6fe822 (diff) | |
download | lombok-51216bed0e723598fa26677ffc3ea0c8d2c3150d.tar.gz lombok-51216bed0e723598fa26677ffc3ea0c8d2c3150d.tar.bz2 lombok-51216bed0e723598fa26677ffc3ea0c8d2c3150d.zip |
[Fixes #2463] Clone type to correctly set annotated type on with methods.
-rw-r--r-- | doc/changelog.markdown | 1 | ||||
-rw-r--r-- | src/core/lombok/javac/handlers/HandleWith.java | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/doc/changelog.markdown b/doc/changelog.markdown index 063945be..00545483 100644 --- a/doc/changelog.markdown +++ b/doc/changelog.markdown @@ -11,6 +11,7 @@ Lombok Changelog * BUGFIX: Using `@SuperBuilder` on a class that has some fairly convoluted generics usage would fail with 'Wrong number of type arguments'. [Issue #2359](https://github.com/rzwitserloot/lombok/issues/2359) [Pull Request #2362](https://github.com/rzwitserloot/lombok/pull/2362) * BUGFIX: Various lombok annotations on classes nested inside enums or interfaces would cause errors in eclipse. [Issue #2369](https://github.com/rzwitserloot/lombok/issues/2369) * BUGFIX: Trying to add `@ExtensionMethod`s with exactly 2 arguments would fail in eclipse. [Issue #1441](https://github.com/rzwitserloot/lombok/issues/1441) [Pull Request #2376](https://github.com/rzwitserloot/lombok/pull/2376) thanks to __@Rawi01__. +* BUGFIX: Javac sets incorrect annotated type on with methods. [Issue #2463](https://github.com/rzwitserloot/lombok/issues/2463) * FEATURE: `@Jacksonized` on a `@Builder` or `@SuperBuilder` will configure [Jackson](https://github.com/FasterXML/jackson) to use this builder when deserializing. [Pull Request #2387](https://github.com/rzwitserloot/lombok/pull/2387) thanks to __@JanRieke__. [@Jacksonized documentation](https://projectlombok.org/features/experimental/Jacksonized). ### v1.18.12 (February 1st, 2020) diff --git a/src/core/lombok/javac/handlers/HandleWith.java b/src/core/lombok/javac/handlers/HandleWith.java index 6977b10e..cc87b1ff 100644 --- a/src/core/lombok/javac/handlers/HandleWith.java +++ b/src/core/lombok/javac/handlers/HandleWith.java @@ -234,7 +234,8 @@ public class HandleWith extends JavacAnnotationHandler<With> { long flags = JavacHandlerUtil.addFinalIfNeeded(Flags.PARAMETER, field.getContext()); List<JCAnnotation> annsOnParam = copyAnnotations(onParam).appendList(copyableAnnotations); - JCVariableDecl param = maker.VarDef(maker.Modifiers(flags, annsOnParam), fieldDecl.name, fieldDecl.vartype, null); + JCExpression pType = cloneType(treeMaker, fieldDecl.vartype, source.get(), source.getContext()); + JCVariableDecl param = maker.VarDef(maker.Modifiers(flags, annsOnParam), fieldDecl.name, pType, null); if (!makeAbstract) { ListBuffer<JCStatement> statements = new ListBuffer<JCStatement>(); |