JDK-8028822 : Error in the documentation for newFactory method of the javax.xml.stream factories
  • Type: Bug
  • Component: xml
  • Sub-Component: javax.xml.stream
  • Affected Version: 8
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2013-11-22
  • Updated: 2017-05-17
  • Resolved: 2013-12-04
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8 b120Fixed
Related Reports
Duplicate :  
Relates :  
Description
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.


Comments
related JCK and sqe test pass after this change
08-01-2014

HG Updates added a comment - 2013-12-10 10:17 URL: http://hg.openjdk.java.net/jdk8/jdk8/jaxp/rev/aed9ca4d33ec User: lana Date: 2013-12-10 18:14:00 +0000
10-12-2013

I accidentally left the wrong issue number 8027973 while editing the commit message. The changeset was therefore pushed under the wrong number: URL: http://hg.openjdk.java.net/jdk8/tl/jaxp/rev/aed9ca4d33ec User: joehw Date: 2013-12-04 08:18:20 +0000
04-12-2013

Release team: Approved for fixing
03-12-2013

This change impacts the following JCK tests: api/javax_xml/stream/XMLEventFactory/JAXP16/index.html#ServiceLoaderInstantiating api/javax_xml/stream/XMLInputFactory/JAXP16/index.html#ServiceLoaderInstantiating api/javax_xml/stream/XMLOutputFactory/JAXP16/index.html#ServiceLoaderInstantiating
26-11-2013