8043484: DPrinter does not compile
authoremc
Thu, 12 Jun 2014 11:32:23 -0400
changeset 24904 668968682128
parent 24903 41e1812d6b4c
child 24905 bd3cf6f243be
8043484: DPrinter does not compile Summary: Make DPrinter compile Reviewed-by: jjg
langtools/test/tools/javac/lib/DPrinter.java
--- a/langtools/test/tools/javac/lib/DPrinter.java	Wed Jun 11 12:49:10 2014 -0400
+++ b/langtools/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);