< prev index next >

src/jdk.jdeps/share/classes/com/sun/tools/javap/AttributeWriter.java

Print this page
*** 78,10 ***
--- 78,11 ---
  import com.sun.tools.classfile.Synthetic_attribute;
  import com.sun.tools.classfile.Type;
  
  import static com.sun.tools.classfile.AccessFlags.*;
  
+ import com.sun.tools.classfile.Preload_attribute;
  import com.sun.tools.javac.util.Assert;
  import com.sun.tools.javac.util.StringUtils;
  
  /*
   *  A writer for writing Attributes as text.

*** 1110,10 ***
--- 1111,31 ---
      public Void visitSynthetic(Synthetic_attribute attr, Void ignore) {
          println("Synthetic: true");
          return null;
      }
  
+     @Override
+     public Void visitPreload(Preload_attribute attr, Void ignore) {
+         boolean first = true;
+         for (int index : attr.value_class_info_index) {
+             if (first) {
+                 println("Classes to be preloaded:");
+                 indent(+1);
+                 first = false;
+             }
+             print("#" + index);
+             print(";");
+             tab();
+             print("// value ");
+             constantWriter.write(index);
+             println();
+         }
+         if (!first)
+             indent(-1);
+         return null;
+     }
+ 
      static String getJavaName(String name) {
          return name.replace('/', '.');
      }
  
      String toHex(byte b, int w) {
< prev index next >