changeset 3398:8e921a530aaf

8043484: DPrinter does not compile Summary: Make DPrinter compile Reviewed-by: jjg
author emc
date Thu, 12 Jun 2014 11:32:23 -0400
parents 40d829674bb4
children 94543b979c40
files test/tools/javac/lib/DPrinter.java
diffstat 1 files changed, 13 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/test/tools/javac/lib/DPrinter.java	Wed Jun 11 12:49:10 2014 -0400
+++ b/test/tools/javac/lib/DPrinter.java	Thu Jun 12 11:32:23 2014 -0400
@@ -21,6 +21,12 @@
  * questions.
  */
 
+/* @test
+ * @bug 8043484
+ * @summary Make sure DPrinter.java compiles
+ * @compile DPrinter.java
+ */
+
 import java.io.File;
 import java.io.IOException;
 import java.io.PrintWriter;
@@ -403,7 +409,7 @@
                 printType("type", sym.type, Details.SUMMARY);
                 printType("erasure", sym.erasure_field, Details.SUMMARY);
                 sym.accept(symVisitor, null);
-                printAnnotations("annotations", sym.getAnnotations(), Details.SUMMARY);
+                printAnnotations("annotations", sym.getMetadata(), Details.SUMMARY);
                 indent(-1);
             }
         }
@@ -529,9 +535,13 @@
     public class TreeVisitor extends JCTree.Visitor {
         @Override
         public void visitTopLevel(JCCompilationUnit tree) {
-            printList("packageAnnotations", tree.packageAnnotations);
+            printList("packageAnnotations", tree.getPackageAnnotations());
+            printList("defs", tree.defs);
+        }
+
+        @Override
+        public void visitPackageDef(JCPackageDecl tree) {
             printTree("pid", tree.pid);
-            printList("defs", tree.defs);
         }
 
         @Override
@@ -945,12 +955,6 @@
      * visit method for its superclass.
      */
     public class TypeVisitor implements Type.Visitor<Void,Void> {
-        public Void visitAnnotatedType(AnnotatedType type, Void ignore) {
-            printList("typeAnnotations", type.getAnnotationMirrors());
-            printType("underlyingType", type.unannotatedType(), Details.FULL);
-            return visitType(type, null);
-        }
-
         public Void visitArrayType(ArrayType type, Void ignore) {
             printType("elemType", type.elemtype, Details.FULL);
             return visitType(type, null);