8005552: c.s.t.javap.AttributeWriter.visitLocalVariableTable() uses incorrect format string
authorvromero
Fri, 28 Jun 2013 14:36:06 +0100
changeset 18665 49867b085faf
parent 18664 5c35de99f6df
child 18666 59ab10272fb5
8005552: c.s.t.javap.AttributeWriter.visitLocalVariableTable() uses incorrect format string Reviewed-by: mcimadamore
langtools/src/share/classes/com/sun/tools/javap/AttributeWriter.java
--- a/langtools/src/share/classes/com/sun/tools/javap/AttributeWriter.java	Fri Jun 28 13:20:44 2013 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javap/AttributeWriter.java	Fri Jun 28 14:36:06 2013 +0100
@@ -365,8 +365,7 @@
         indent(+1);
         println("Start  Length  Slot  Name   Signature");
         for (LocalVariableTable_attribute.Entry entry : attr.local_variable_table) {
-            Formatter formatter = new Formatter();
-            println(formatter.format("%8d %7d %5d %5s   %s",
+            println(String.format("%5d %7d %5d %5s   %s",
                     entry.start_pc, entry.length, entry.index,
                     constantWriter.stringValue(entry.name_index),
                     constantWriter.stringValue(entry.descriptor_index)));
@@ -609,7 +608,8 @@
         public Void visit_append_frame(StackMapTable_attribute.append_frame frame, Void p) {
             printHeader(frame);
             println(" /* append */");
-            println("     offset_delta = " + frame.offset_delta);
+            indent(+1);
+            println("offset_delta = " + frame.offset_delta);
             printMap("locals", frame.locals);
             return null;
         }