--- old/src/javax/xml/parsers/DocumentBuilderFactory.java 2012-12-06 18:30:11.000000000 +0100 +++ new/src/javax/xml/parsers/DocumentBuilderFactory.java 2012-12-06 18:30:11.000000000 +0100 @@ -40,9 +40,6 @@ public abstract class DocumentBuilderFactory { - /** The default property name according to the JAXP spec */ - private static final String DEFAULT_PROPERTY_NAME = "javax.xml.parsers.DocumentBuilderFactory"; - private boolean validating = false; private boolean namespaceAware = false; private boolean whitespace = false; @@ -50,8 +47,6 @@ private boolean ignoreComments = false; private boolean coalescing = false; - private boolean canonicalState = false; - /** *

Protected constructor to prevent instantiation. * Use {@link #newInstance()}.

@@ -66,6 +61,7 @@ * This method uses the following ordered lookup procedure to determine * the DocumentBuilderFactory implementation class to * load: + *

* + *

+ * In case of {@link java.util.ServiceConfigurationError service + * configuration error}, or if no implementation is found, + * a {@link javax.xml.parsers.FactoryConfigurationError} + * will be thrown. + *

* * Once an application has obtained a reference to a * DocumentBuilderFactory it can use the factory to @@ -117,17 +119,11 @@ * available or cannot be instantiated. */ public static DocumentBuilderFactory newInstance() { - try { - return (DocumentBuilderFactory) FactoryFinder.find( + return FactoryFinder.find( /* The default property name according to the JAXP spec */ - "javax.xml.parsers.DocumentBuilderFactory", + DocumentBuilderFactory.class, // "javax.xml.parsers.DocumentBuilderFactory" /* The fallback implementation class name */ "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl"); - } catch (FactoryFinder.ConfigurationError e) { - throw new FactoryConfigurationError(e.getException(), - e.getMessage()); - } - } /** @@ -165,13 +161,8 @@ * @since 1.6 */ public static DocumentBuilderFactory newInstance(String factoryClassName, ClassLoader classLoader){ - try { //do not fallback if given classloader can't find the class, throw exception return (DocumentBuilderFactory) FactoryFinder.newInstance(factoryClassName, classLoader, false); - } catch (FactoryFinder.ConfigurationError e) { - throw new FactoryConfigurationError(e.getException(), - e.getMessage()); - } } /** @@ -391,75 +382,64 @@ public abstract Object getAttribute(String name) throws IllegalArgumentException; - /** - *

Set a feature for this DocumentBuilderFactory and DocumentBuilders created by this factory.

- * - *

- * Feature names are fully qualified {@link java.net.URI}s. - * Implementations may define their own features. - * A {@link ParserConfigurationException} is thrown if this DocumentBuilderFactory or the - * DocumentBuilders it creates cannot support the feature. - * It is possible for a DocumentBuilderFactory to expose a feature value but be unable to change its state. - *

- * - *

- * All implementations are required to support the {@link javax.xml.XMLConstants#FEATURE_SECURE_PROCESSING} feature. - * When the feature is:

- * - * - * @param name Feature name. - * @param value Is feature state true or false. - * - * @throws ParserConfigurationException if this DocumentBuilderFactory or the DocumentBuilders - * it creates cannot support this feature. + /** + *

Set a feature for this DocumentBuilderFactory and DocumentBuilders created by this factory.

+ * + *

+ * Feature names are fully qualified {@link java.net.URI}s. + * Implementations may define their own features. + * A {@link ParserConfigurationException} is thrown if this DocumentBuilderFactory or the + * DocumentBuilders it creates cannot support the feature. + * It is possible for a DocumentBuilderFactory to expose a feature value but be unable to change its state. + *

+ * + *

+ * All implementations are required to support the {@link javax.xml.XMLConstants#FEATURE_SECURE_PROCESSING} feature. + * When the feature is:

+ * + * + * @param name Feature name. + * @param value Is feature state true or false. + * + * @throws ParserConfigurationException if this DocumentBuilderFactory or the DocumentBuilders + * it creates cannot support this feature. * @throws NullPointerException If the name parameter is null. - */ - public abstract void setFeature(String name, boolean value) - throws ParserConfigurationException; - - /** - *

Get the state of the named feature.

- * - *

- * Feature names are fully qualified {@link java.net.URI}s. - * Implementations may define their own features. - * An {@link ParserConfigurationException} is thrown if this DocumentBuilderFactory or the - * DocumentBuilders it creates cannot support the feature. - * It is possible for an DocumentBuilderFactory to expose a feature value but be unable to change its state. - *

- * - * @param name Feature name. - * - * @return State of the named feature. - * - * @throws ParserConfigurationException if this DocumentBuilderFactory - * or the DocumentBuilders it creates cannot support this feature. - */ - public abstract boolean getFeature(String name) - throws ParserConfigurationException; - - - /**

Get current state of canonicalization.

- * - * @return current state canonicalization control - */ - /* - public boolean getCanonicalization() { - return canonicalState; - } - */ + */ + public abstract void setFeature(String name, boolean value) + throws ParserConfigurationException; + + /** + *

Get the state of the named feature.

+ * + *

+ * Feature names are fully qualified {@link java.net.URI}s. + * Implementations may define their own features. + * An {@link ParserConfigurationException} is thrown if this DocumentBuilderFactory or the + * DocumentBuilders it creates cannot support the feature. + * It is possible for an DocumentBuilderFactory to expose a feature value but be unable to change its state. + *

+ * + * @param name Feature name. + * + * @return State of the named feature. + * + * @throws ParserConfigurationException if this DocumentBuilderFactory + * or the DocumentBuilders it creates cannot support this feature. + */ + public abstract boolean getFeature(String name) + throws ParserConfigurationException; /** @@ -488,17 +468,6 @@ } - /*

Set canonicalization control to true or - * false.

- * - * @param state of canonicalization - */ - /* - public void setCanonicalization(boolean state) { - canonicalState = state; - } - */ - /** *

Set the {@link Schema} to be used by parsers created * from this factory.