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

Repository.instanceOf() can throw NullPointerException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 5.2
    • Main
    • None

    Description

      org.apache.bcel.Repository.instanceOf(JavaClass clazz, JavaClass super_class)
      can throw NullPointerException. Here's how:

      1. instanceOf(String, String) is called

      2. it calls lookupClass(String) using "clazz" as a parameter

      3. in lookupClass(String), the inner _repository object throws a
      ClassNotFoundException, so lookupClass() returns null

      4. instanceOf(String, String) calls instanceOf(JavaClass, JavaClass) with the
      first parameter null

      5. instanceOf(JavaClass, JavaClass) invokes instanceOf(JavaClass) on its first
      parameter, resulting in a NullPointerException

      Attachments

        Activity

          People

            issues@commons.apache.org Apache Commons Developers
            daveho@cs.umd.edu David Hovemeyer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: