RFR: javax.xml.stream: Using ServiceLoader to load JAXP stream factories (7169894: JAXP Plugability Layer: using service loader)

Daniel Fuchs daniel.fuchs at oracle.com
Mon Dec 17 17:43:59 UTC 2012


Hi,

Here is a new webrev in the series that addresses using ServiceLoader in
JAXP for JDK 8.

7169894: JAXP Plugability Layer: using service loader

This changeset addresses modification in the javax.xml.stream
package.
It is similar to changes proposed for the javax.xml.parsers
package [1], with a few differences due to the specificity of
javax.xml.stream.

Namely:

1. The XMLXxxxFactory.newInstance methods that takes parameter takes
    a property name, rather than a class name, and thus calls
    FactoryFinder.find.

2. One of the deprecated XMLOutputFactory.newInstance method had a
    bug - it used to return an XMLInputFactory - and was deprecated
    because of that - so I did preserve the bug.

3. The noarg newFactory() methods were leaking instances of the
    private FactoryFinder$ConfigurationError - my patch corrects
    that since it removes FactoryFinder$ConfigurationError.

4. In FactoryFinder.find() the ClassLoader parameter is often ignored,
    which makes the factories in the stream package behave differently
    from theirs cousins in the other packages. I believe this was an
    oversight due to (1).
    My patch will not fix that - I will instead log this as a separate
    issue.


<http://cr.openjdk.java.net/~dfuchs/JDK-7169894/javax.xml.stream/webrev.00>

best regards,

-- daniel

previous webrevs in the series:

[1] javax.xml.parsers:
<http://cr.openjdk.java.net/~dfuchs/JDK-7169894/javax.xml.parser/webrev.06>

[2] javax.xml.datatype:
<http://cr.openjdk.java.net/~dfuchs/JDK-7169894/javax.xml.datatype/webrev.02>



More information about the core-libs-dev mailing list