--- old/src/javax/xml/transform/TransformerFactory.java 2012-08-27 21:27:27.092056300 -0700 +++ new/src/javax/xml/transform/TransformerFactory.java 2012-08-27 21:27:26.317732900 -0700 @@ -75,11 +75,13 @@ * of any property in jaxp.properties after it has been read for the first time. * *
META-INF/services/javax.xml.transform.TransformerFactory
- * in jars available to the runtime.
+ * Uses the service-provider loading facilities, defined by the {@link java.util.ServiceLoader} class, to attempt + * to locate and load an implementation of the service. In case of multiple providers, the first non-default implementation + * shall be instantiated and returned. The default implementation is returned if it is the only one + * found by the service loader.
+ *+ * If a misconfigured provider is encountered and {@link java.util.ServiceConfigurationError} is thrown, the error will be wrapped + * in a {@link javax.xml.transform.TransformerFactoryConfigurationError}.
*TransformerFactory
instance.
@@ -97,18 +99,12 @@
*/
public static TransformerFactory newInstance()
throws TransformerFactoryConfigurationError {
- try {
- return (TransformerFactory) FactoryFinder.find(
+ return (TransformerFactory) FactoryFinder.find(TransformerFactory.class,
/* The default property name according to the JAXP spec */
"javax.xml.transform.TransformerFactory",
/* The fallback implementation class name, XSLTC */
"com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl");
- } catch (FactoryFinder.ConfigurationError e) {
- throw new TransformerFactoryConfigurationError(
- e.getException(),
- e.getMessage());
}
- }
/**
* Obtain a new instance of a TransformerFactory
from factory class name.
@@ -147,15 +143,9 @@
*/
public static TransformerFactory newInstance(String factoryClassName, ClassLoader classLoader)
throws TransformerFactoryConfigurationError{
- try {
//do not fallback if given classloader can't find the class, throw exception
return (TransformerFactory) FactoryFinder.newInstance(factoryClassName, classLoader, false);
- } catch (FactoryFinder.ConfigurationError e) {
- throw new TransformerFactoryConfigurationError(
- e.getException(),
- e.getMessage());
}
- }
/**
*
Process the Source
into a Transformer
* Object
. The Source
is an XSLT document that