c.s.t.javap.AttributeWriter.visitLocalVariableTable() uses incorrect format string

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 8
    • Affects Version/s: 7u9, 8
    • Component/s: tools
    • b98
    • generic
    • generic
    • Not verified

      In changeset 347 to the jdk8tl langtools repository, some whitespace was removed from println()s. In the case of visitLocalVariableTable() and visitLocalVariableTypeTable(), the same changes were not applied to both methods. The former was not switched to use String.format() and the format string was not changed to start with %5d (instead of %8d).

      The latest 7u and 8 builds exhibit the same behavior:
            LocalVariableTable:
              Start Length Slot Name Signature
                   150 5 6 e Ljava/lang/Exception;
                     0 156 0 this LC4;
                     0 156 1 a [Ljava/lang/String;
                    52 104 2 f0 Ljava/io/File;
                    63 93 3 f1 Ljava/io/File;
                    66 90 4 cf0 Lcom/sun/tools/classfile/ClassFile;
                    69 87 5 cf1 Lcom/sun/tools/classfile/ClassFile;

      Running javap -v -p on any class file that has a LocalVariableTable attribute shows the columns are misaligned.

            Assignee:
            Vicente Arturo Romero Zaldivar
            Reporter:
            Andrew Gross
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: