JDK-6271807 : javap should print nice version of StackMapTable attribute
  • Type: Bug
  • Component: tools
  • Sub-Component: javap
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2005-05-17
  • Updated: 2010-04-02
  • Resolved: 2005-07-25
Related Reports
Duplicate :  
Description
The JDK 6.0 will be creating a StackMapTable attribute.
javap doesn't print these very well:

>  cat HelloWorld.java
public class HelloWorld {
    public static void main(String args[]) {

        /* Use a generic type */
        java.util.List<String> l = new java.util.ArrayList<String>();
        String.format("%s", "");

        /* Just some code with branches */
        try {
            if ( args.length == 0 ) {
                System.out.println("No arguments passed in");
            } else {
                System.out.println("No arguments passed in");
            }
        } catch ( Throwable e ) {
            System.out.println("ERROR: System.out.println() did a throw");
        } finally {
            System.out.println("Hello, world!");
        }
    }
}

> /opt/java/jdk1.6.0/bin/javac -target 1.6 -g HelloWorld.java
> /opt/java/jdk1.6.0/bin/javap -verbose HelloWorld | tail -15
   line 19: 87
   line 20: 89
  LocalVariableTable:
   Start  Length  Slot  Name   Signature
   59      8      2    e       Ljava/lang/Throwable;
   0      90      0    args       [Ljava/lang/String;
   8      82      1    l       Ljava/util/List;
  LocalVariableTypeTable: length = 0xC
   00 01 00 08 00 52 00 1C 00 1F 00 01
  StackMapTable: length = 0x12                        <---- StackMap Attribute
   00 05 FFFFFFFC 00 27 07 00 21 07 4A 07 00 22 53 07 00
   22 0A

}
###@###.### 2005-05-17 17:11:29 GMT