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

Daniel Fuchs daniel.fuchs at oracle.com
Tue Dec 18 22:02:06 UTC 2012


On 12/18/12 9:06 PM, Mandy Chung wrote:
> In FactoryFinder.newInstanceNoServiceLoader method, L223, 226 - 
> NoSuchMethodException will be thrown if such method doesn't exist.  
> creationMethod will not be null.
Thanks - yes - you're right of course - no need to check for 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.
Oops - my bad. That's a mistake - I did too many successive changes - 
should be creationMethod.invoke(null) of course.
And my tests didn't even catch it!
>
> 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.
3 successive boolean parameters... I hate that ;-)  Yes I think I can do 
this cleanup...

Thanks Mandy,

-- daniel

>
> Thanks
> Mandy




More information about the core-libs-dev mailing list