aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <roels@.tis.local>2009-11-27 17:37:26 +0100
committerunknown <roels@.tis.local>2009-11-27 17:37:26 +0100
commit645a0b06c76ce6fbad8d48afe0161b21d04046bb (patch)
treeef56410f42939e04daab26dc83d91ffba08485f5
parentf2de0a28e70ff284fe6fac626c39df66f4bf3e89 (diff)
downloadlombok-645a0b06c76ce6fbad8d48afe0161b21d04046bb.tar.gz
lombok-645a0b06c76ce6fbad8d48afe0161b21d04046bb.tar.bz2
lombok-645a0b06c76ce6fbad8d48afe0161b21d04046bb.zip
Removed empty () for annotation without parameters
-rw-r--r--src/delombok/lombok/delombok/PrettyCommentsPrinter.java8
-rw-r--r--test/delombok/resource/after/Annotation.java7
-rw-r--r--test/delombok/resource/before/Annotation.java7
3 files changed, 19 insertions, 3 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/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();
+ }
+}