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

[StAX] XMLInputFactory.newInstance(String, ClassLoader) does not use bootstrap loader

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • 6-pool
    • javadb_10.0
    • xml

      I am using JDK 1.6.0_02. I am referring to javax.xml.stream.XMLInputFactory.newInstance(String, ClassLoader) method. This method does not treat "null classloader" correctly. If I want to use the classloader that loads XMLInputFactory.class, then in JDK 1.6 env, it is obviously null since the bootstrap classloader has this class. In such a situation, the implementation in JDK 1.6 falls back to Thread's context class loader, which I think is against the behavior defined in the spec. It should use the three argument variant of Class.forName with null as the last argument.

            joehw Joe Wang
            sanjsaho Sanjeeb Sahoo
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: