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

Mandy Chung mandy.chung at oracle.com
Tue Dec 18 20:06:08 UTC 2012

On 12/18/12 8:42 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.transform
> package.
> It is similar to changes proposed for the javax.xml.parsers
> package [1], with only a few differences due to the specificity of
> javax.xml.transform.
> <http://cr.openjdk.java.net/~dfuchs/JDK-7169894/javax.xml.transform/webrev.00/> 

In FactoryFinder.newInstanceNoServiceLoader method, L223, 226 - 
NoSuchMethodException will be thrown if such method doesn't exist.  
creationMethod will not be null.  L236 - this change is not needed, 
right?  The method is a static no-arg method.  You passed an additional 
argument creationMethod as the first parameter although it's harmless as 
it's ignored.

A minor comment:

  151     static<T>  T newInstance(Class<T>  type, String className, ClassLoader cl, boolean doFallback)
  152         throws TransformerFactoryConfigurationError
  153     {
  154         return newInstance(type, className, cl, doFallback, false, false);
  155     }

The FactoryFinder.newInstance method 4-argument version is only called by
TransformerFactory.newInstance(String factoryClassName, ClassLoader classLoader).
Perhaps you can clean this up TransformerFactory to call the Factory.newInstance
method 6-argument version.


More information about the core-libs-dev mailing list