This commit is contained in:
Lana Steuck 2012-08-30 20:10:34 -07:00
commit 955d253fed

View File

@ -49,6 +49,10 @@ import java.util.Iterator;
public abstract class XMLEventFactory { public abstract class XMLEventFactory {
protected XMLEventFactory(){} protected XMLEventFactory(){}
static final String JAXPFACTORYID = "javax.xml.stream.XMLEventFactory";
static final String DEFAULIMPL = "com.sun.xml.internal.stream.events.XMLEventFactoryImpl";
/** /**
* Create a new instance of the factory * Create a new instance of the factory
* @throws FactoryConfigurationError if an instance of this factory cannot be loaded * @throws FactoryConfigurationError if an instance of this factory cannot be loaded
@ -57,8 +61,8 @@ public abstract class XMLEventFactory {
throws FactoryConfigurationError throws FactoryConfigurationError
{ {
return (XMLEventFactory) FactoryFinder.find( return (XMLEventFactory) FactoryFinder.find(
"javax.xml.stream.XMLEventFactory", JAXPFACTORYID,
"com.sun.xml.internal.stream.events.XMLEventFactoryImpl"); DEFAULIMPL);
} }
/** /**
@ -90,8 +94,8 @@ public abstract class XMLEventFactory {
throws FactoryConfigurationError throws FactoryConfigurationError
{ {
return (XMLEventFactory) FactoryFinder.find( return (XMLEventFactory) FactoryFinder.find(
"javax.xml.stream.XMLEventFactory", JAXPFACTORYID,
"com.sun.xml.internal.stream.events.XMLEventFactoryImpl"); DEFAULIMPL);
} }
/** /**
@ -114,7 +118,7 @@ public abstract class XMLEventFactory {
throws FactoryConfigurationError { throws FactoryConfigurationError {
try { try {
//do not fallback if given classloader can't find the class, throw exception //do not fallback if given classloader can't find the class, throw exception
return (XMLEventFactory) FactoryFinder.newInstance(factoryId, classLoader, false); return (XMLEventFactory) FactoryFinder.find(factoryId, classLoader, null);
} catch (FactoryFinder.ConfigurationError e) { } catch (FactoryFinder.ConfigurationError e) {
throw new FactoryConfigurationError(e.getException(), throw new FactoryConfigurationError(e.getException(),
e.getMessage()); e.getMessage());
@ -141,7 +145,7 @@ public abstract class XMLEventFactory {
throws FactoryConfigurationError { throws FactoryConfigurationError {
try { try {
//do not fallback if given classloader can't find the class, throw exception //do not fallback if given classloader can't find the class, throw exception
return (XMLEventFactory) FactoryFinder.newInstance(factoryId, classLoader, false); return (XMLEventFactory) FactoryFinder.find(factoryId, classLoader, null);
} catch (FactoryFinder.ConfigurationError e) { } catch (FactoryFinder.ConfigurationError e) {
throw new FactoryConfigurationError(e.getException(), throw new FactoryConfigurationError(e.getException(),
e.getMessage()); e.getMessage());