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

javap should be more robust in the face of invalid class files

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 17
    • 17
    • tools
    • None
    • b12

      Below is an example of how javap fails when run to disassemble a class file with a Signature attribute with an index into the constant pool of the wrong type. In this example it would have been useful if javap reported the reason why it could not parse the the class file.

      Error: A serious internal error has occurred: java.lang.IllegalStateException: !'!, '
      Please file a bug report, and include the following information:
      java.lang.IllegalStateException: !'!, '
          at jdk.jdeps/com.sun.tools.classfile.Signature.parseTypeSignature(Signature.java:180)
          at jdk.jdeps/com.sun.tools.classfile.Signature.parse(Signature.java:104)
          at jdk.jdeps/com.sun.tools.classfile.Signature.getType(Signature.java:48)
          at jdk.jdeps/com.sun.tools.javap.ClassWriter.writeMethod(ClassWriter.java:499)
          at jdk.jdeps/com.sun.tools.javap.ClassWriter.writeMethods(ClassWriter.java:471)
          at jdk.jdeps/com.sun.tools.javap.ClassWriter.write(ClassWriter.java:269)
          at jdk.jdeps/com.sun.tools.javap.JavapTask.write(JavapTask.java:850)
          at jdk.jdeps/com.sun.tools.javap.JavapTask.writeClass(JavapTask.java:669)
          at jdk.jdeps/com.sun.tools.javap.JavapTask.run(JavapTask.java:614)
          at jdk.jdeps/com.sun.tools.javap.JavapTask.run(JavapTask.java:464)
          at jdk.jdeps/com.sun.tools.javap.Main.main(Main.java:47)

            asotona Adam Sotona
            alanb Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: