Uploaded image for project: 'Commons BCEL'
  1. Commons BCEL
  2. BCEL-173

ClassParser fails to parse JDK classes in Java 8: ClassFormatException: Invalid byte tag in constant pool

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 5.0, 5.1, 5.2
    • 6.0
    • None
    • None

    Description

      See attached sample project that reproduces the failure. On Java 7, it prints info about the ConcurrentMap class. On Java 8, it encounters the following exception:

      Exception in thread "main" org.apache.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 18
      	at org.apache.bcel.classfile.Constant.readConstant(Constant.java:146)
      	at org.apache.bcel.classfile.ConstantPool.<init>(ConstantPool.java:67)
      	at org.apache.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:222)
      	at org.apache.bcel.classfile.ClassParser.parse(ClassParser.java:136)
      	at TestMain.main(TestMain.java:11)
      

      To use the sample project, extract it and then run "./gradlew clean run".

      Attachments

        1. bcel-bug.tgz
          49 kB
          David Carr
        2. bceltestcase.zip
          205 kB
          David L Diehl

        Issue Links

          Activity

            People

              michael-o Michael Osipov
              david@carr.name David Carr
              Votes:
              1 Vote for this issue
              Watchers:
              28 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: