Empty statements no longer being printed to be consistent with Javac7 which seems to just remove these from the AST entirely.

This commit is contained in:
Reinier Zwitserloot
2012-10-25 00:08:02 +02:00
parent d2808d407a
commit cec7dfd190
3 changed files with 3 additions and 4 deletions
@@ -428,7 +428,7 @@ public class PrettyCommentsPrinter extends JCTree.Visitor {
*/
public void printStat(JCTree tree) throws IOException {
if (isEmptyStat(tree)) {
printEmptyStat();
// printEmptyStat(); // -- starting in java 7, these get lost, so to be consistent, we never print them.
} else {
printExpr(tree, TreeInfo.notExpression);
}
@@ -568,7 +568,9 @@ public class PrettyCommentsPrinter extends JCTree.Visitor {
}
print(";");
println();
int x = 0;
for (List<JCTree> l = stats; l.nonEmpty(); l = l.tail) {
x++;
if (!isEnumerator(l.head)) {
align();
printStat(l.head);
-1
View File
@@ -3,7 +3,6 @@ enum Ranks {
HEARTS,
DIAMONDS,
SPADES;
;
}
enum Complex {
RED("ff0000"),
@@ -6,8 +6,6 @@ interface Interfaces {
DIAMONDS,
SPADES;
}
;
;
int x = 10;
void y();
int a = 20;