From 927a6774f5713c2103563b56ba1b57b6fc09ceaa Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Tue, 18 Jun 2019 15:36:26 +0200 Subject: [fixes #2140] when pretty-printing (delombok) varargs, only turn array brackets into varargs for the actual top-level type, not for arrays inside the type, such as an array as generics component. --- doc/changelog.markdown | 1 + src/delombok/lombok/delombok/PrettyPrinter.java | 3 +++ 2 files changed, 4 insertions(+) diff --git a/doc/changelog.markdown b/doc/changelog.markdown index 7f1efb94..e9564eb0 100644 --- a/doc/changelog.markdown +++ b/doc/changelog.markdown @@ -4,6 +4,7 @@ Lombok Changelog ### v1.18.9 "Edgy Guinea Pig" * ENHANCEMENT: Thanks to Mark Haynes, the `staticConstructor` will now also be generated if a (private) constructor already exists. [Issue #2100](https://github.com/rzwitserloot/lombok/issues/2100) * ENHANCEMENT: `val` is now capable of decoding the type of convoluted expressions (particularly if the right hand side involves lambdas and conditional (ternary) expressions). [Pull Request #2109](https://github.com/rzwitserloot/lombok/pull/2109) with thanks to Alexander Bulgakov. +* BUGFIX: Delombok would turn something like `List...` in a method parameter to `List...` [Issue #2140](https://github.com/rzwitserloot/lombok/issues/2140) ### v1.18.8 (May 7th, 2019) * FEATURE: You can now configure `@FieldNameConstants` to `CONSTANT_CASE` the generated constants, using a `lombok.config` option. See the [FieldNameConstants documentation](https://projectlombok.org/features/experimental/FieldNameConstants). [Issue #2092](https://github.com/rzwitserloot/lombok/issues/2092). diff --git a/src/delombok/lombok/delombok/PrettyPrinter.java b/src/delombok/lombok/delombok/PrettyPrinter.java index 3477c51c..1532319f 100644 --- a/src/delombok/lombok/delombok/PrettyPrinter.java +++ b/src/delombok/lombok/delombok/PrettyPrinter.java @@ -692,7 +692,10 @@ public class PrettyPrinter extends JCTree.Visitor { @Override public void visitTypeApply(JCTypeApply tree) { print(tree.clazz); print("<"); + boolean temp = innermostArrayBracketsAreVarargs; + innermostArrayBracketsAreVarargs = false; print(tree.arguments, ", "); + innermostArrayBracketsAreVarargs = temp; print(">"); } -- cgit