Annotations on parameters should be inline

This commit is contained in:
Roel Spilker committed 2009-11-29 01:04:22 +01:00
1 parent ffb78b6af6
commit 0b36718d20
3 files changed
+16 -4

No files matched your search

@@ -154,7 +154,8 @@ public class PrettyCommentsPrinter extends JCTree.Visitor {
private List<Comment> comments;
private final JCCompilationUnit cu;
private boolean newLine = true;
private boolean inParams = false;
public PrettyCommentsPrinter(Writer out, JCCompilationUnit cu, List<Comment> comments) {
this.out = out;
this.comments = comments;
@@ -370,8 +371,13 @@ public class PrettyCommentsPrinter extends JCTree.Visitor {
public void printAnnotations(List<JCAnnotation> trees) throws IOException {
for (List<JCAnnotation> l = trees; l.nonEmpty(); l = l.tail) {
printStat(l.head);
println();
align();
if (inParams) {
print(" ");
}
else {
println();
align();
}
}
}
@@ -605,7 +611,9 @@ public class PrettyCommentsPrinter extends JCTree.Visitor {
print(" " + tree.name);
}
print("(");
inParams = true;
printExprs(tree.params);
inParams = false;
print(")");
if (tree.thrown.nonEmpty()) {
print(" throws ");
+3 -1
View File
@@ -4,4 +4,6 @@ class Annotation {
public String toString() {
return super.toString();
}
}
public void method(@SuppressWarnings("unused") int x) {
}
}
@@ -4,4 +4,6 @@ class Annotation {
public String toString() {
return super.toString();
}
public void method(@SuppressWarnings("unused") int x) {
}
}