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

Error in the documentation for newFactory method of the javax.xml.stream factories

XMLWordPrintable

      Affected factories:
      javax.xml.stream.XMLEventFactory
      javax.xml.stream.XMLInputFactory
      javax.xml.stream.XMLOutputFactory

      Method:
      newFactory(String factoryId, ClassLoader classLoader)

      The parameter classLoader was ignored in the current documentation:

      If factoryId is "javax.xml.stream.XML*Factory", use the service-provider loading facilities, defined by the ServiceLoader class, to attempt to locate and load an implementation of the service using the default loading mechanism: the service-provider loading facility will use the current thread's context class loader to attempt to load the service. If the context class loader is null, the system class loader will be used.


      Suggested fix:
      If factoryId is "javax.xml.stream.XML*Factory", use the service-provider loading facilities, defined by the ServiceLoader class, to attempt to locate and load an implementation of the service using the specified ClassLoader. If the classLoader is null, the default loading mechanism will apply: That is, the service-provider loading facility will use the current thread's context class loader to attempt to load the service. If the context class loader is null, the system class loader will be used.

      Also adding a API Note for the classLoader parameter:
      @apiNote The parameter factoryId defined here is inconsistent with that of other JAXP factories where the first parameter is fully qualified factory class name that provides implementation of the factory.

            joehw Joe Wang
            joehw Joe Wang
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: