diff options
-rw-r--r-- | src/delombok/lombok/delombok/PrettyCommentsPrinter.java | 8 | ||||
-rw-r--r-- | test/core/src/lombok/TestViaDelombok.java | 2 | ||||
-rw-r--r-- | test/delombok/resource/after/Annotation.java | 7 | ||||
-rw-r--r-- | test/delombok/resource/before/Annotation.java | 7 |
4 files changed, 20 insertions, 4 deletions
diff --git a/src/delombok/lombok/delombok/PrettyCommentsPrinter.java b/src/delombok/lombok/delombok/PrettyCommentsPrinter.java index 611dd417..785826f1 100644 --- a/src/delombok/lombok/delombok/PrettyCommentsPrinter.java +++ b/src/delombok/lombok/delombok/PrettyCommentsPrinter.java @@ -1358,9 +1358,11 @@ public class PrettyCommentsPrinter extends JCTree.Visitor { try { print("@"); printExpr(tree.annotationType); - print("("); - printExprs(tree.args); - print(")"); + if (tree.args.nonEmpty()) { + print("("); + printExprs(tree.args); + print(")"); + } } catch (IOException e) { throw new UncheckedIOException(e); } diff --git a/test/core/src/lombok/TestViaDelombok.java b/test/core/src/lombok/TestViaDelombok.java index e8070723..f9ea95f2 100644 --- a/test/core/src/lombok/TestViaDelombok.java +++ b/test/core/src/lombok/TestViaDelombok.java @@ -64,7 +64,7 @@ public class TestViaDelombok { String expected = expectedLines[i]; String actual = actualLines[i]; if (!expected.equals(actual)) { - fail(String.format("Difference in line %s(%d):\n`%s`\n`%s`\n", name, i, expected, actual)); + fail(String.format("Difference in line %s(%d):\nExpected `%s`\nGot `%s`\n", name, i, expected, actual)); } } if (expectedLines.length > actualLines.length) { diff --git a/test/delombok/resource/after/Annotation.java b/test/delombok/resource/after/Annotation.java new file mode 100644 index 00000000..38eddbf7 --- /dev/null +++ b/test/delombok/resource/after/Annotation.java @@ -0,0 +1,7 @@ +@SuppressWarnings("all") +class Annotation { + @Override + public String toString() { + return super.toString(); + } +} diff --git a/test/delombok/resource/before/Annotation.java b/test/delombok/resource/before/Annotation.java new file mode 100644 index 00000000..38eddbf7 --- /dev/null +++ b/test/delombok/resource/before/Annotation.java @@ -0,0 +1,7 @@ +@SuppressWarnings("all") +class Annotation { + @Override + public String toString() { + return super.toString(); + } +} |