public static DocumentBuilderFactory newInstance() { try { return (DocumentBuilderFactory) ClassStuff.createFactory ( defaultPropName, "gnu.xml.dom.JAXPFactory"); } catch (ClassCastException e) { throw new FactoryConfigurationError (e, "Factory class is the wrong type"); } }
public static DocumentBuilderFactory newInstance() { ClassLoader loader = Thread.currentThread().getContextClassLoader(); if (loader == null) { loader = DocumentBuilderFactory.class.getClassLoader(); } String className = null; int count = 0; do { className = getFactoryClassName(loader, count++); if (className != null) { try { Class t = (loader != null) ? loader.loadClass(className) : Class.forName(className); return (DocumentBuilderFactory) t.newInstance(); } catch (ClassNotFoundException e) { className = null; } catch (Exception e) { throw new FactoryConfigurationError(e, "error instantiating class " + className); } } } while (className == null && count < 3); return new gnu.xml.dom.DomDocumentBuilderFactory(); }
	public static DocumentBuilderFactory newInstance() {		try {		    return (DocumentBuilderFactory)			ClassStuff.createFactory (				defaultPropName, 				"gnu.xml.dom.JAXPFactory");		} catch (ClassCastException e) {			throw new FactoryConfigurationError (e,				"Factory class is the wrong type");		}	}