langtools/src/share/classes/com/sun/tools/javac/tree/Pretty.java
changeset 4413 2ae470f0b492
parent 3149 0cd06d598d6f
child 4696 45b45d9c96dd
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/Pretty.java	Thu Nov 19 11:43:43 2009 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/Pretty.java	Thu Nov 19 11:49:27 2009 -0800
@@ -54,7 +54,7 @@
     /** Set when we are producing source output.  If we're not
      *  producing source output, we can sometimes give more detail in
      *  the output even though that detail would not be valid java
-     *  soruce.
+     *  source.
      */
     private final boolean sourceOutput;
 
@@ -489,6 +489,20 @@
                 print("/*public static final*/ ");
                 print(tree.name);
                 if (tree.init != null) {
+                    if (sourceOutput && tree.init.getTag() == JCTree.NEWCLASS) {
+                        print(" /*enum*/ ");
+                        JCNewClass init = (JCNewClass) tree.init;
+                        if (init.args != null && init.args.nonEmpty()) {
+                            print("(");
+                            print(init.args);
+                            print(")");
+                        }
+                        if (init.def != null && init.def.defs != null) {
+                            print(" ");
+                            printBlock(init.def.defs);
+                        }
+                        return;
+                    }
                     print(" /* = ");
                     printExpr(tree.init);
                     print(" */");