*** tmp/javax/xml/datatype/FactoryFinder.java 2009-02-16 00:09:32.000000000 +0000 --- xml-commons-external-1.4.01/javax/xml/datatype/FactoryFinder.java 2010-01-19 11:03:01.070864200 +0000 *************** *** 143,164 **** */ static Object newInstance( String className, ! ClassLoader classLoader) throws ConfigurationError { ! try { ! Class spiClass; ! if (classLoader == null) { ! spiClass = Class.forName(className); } else { ! spiClass = classLoader.loadClass(className); ! } ! ! if (debug) { ! debugPrintln("Loaded " + className + " from " + which(spiClass)); } ! ! return spiClass.newInstance(); } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); --- 145,179 ---- */ static Object newInstance( String className, ! ClassLoader cl) throws ConfigurationError { ! try { ! Class providerClass; ! if (cl == null) { ! // If classloader is null Use the bootstrap ClassLoader. ! // Thus Class.forName(String) will use the current ! // ClassLoader which will be the bootstrap ClassLoader. ! providerClass = Class.forName(className); } else { ! try { ! providerClass = cl.loadClass(className); ! } catch (ClassNotFoundException x) { ! // Fall back to current classloader ! cl = FactoryFinder.class.getClassLoader(); ! if (cl != null) { ! providerClass = cl.loadClass(className); ! } ! else { ! providerClass = Class.forName(className); ! } ! } } ! ! Object instance = providerClass.newInstance(); ! if (debug) debugPrintln("created new instance of " + providerClass + ! " using ClassLoader: " + cl); ! return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x);