Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6271804

com.sun.org.apache.bcel missing StackMapTable Code Attribute (version 50 classfiles)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 6
    • xml

        The JDK 6.0 will be creating a StackMapTable attribute that is required for verification.
        This attribute contains byte code offsets, constant pool index values, and descriptions of the stack contents. The BCEL code re-writes classfiles and will need to process these attributes.

        > 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:08:55 GMT

              jsuttorsunw Jeff Suttor (Inactive)
              ohair Kelly Ohair (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: