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

Mandy Chung mandy.chung at oracle.com
Tue Dec 18 06:02:56 UTC 2012


Hi Daniel,

There are currently several different FactoryFinder class in the JAXP 
implementation and there might be slight difference in each of them.  Do 
you know if it has been looked into whether it's feasible to merge them 
into a single utility class?  I suspect someone might have brought this 
up in the past.

Mandy

On 12/17/2012 9:43 AM, Daniel Fuchs wrote:
> 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