8049378: Examine references to ${java.home}/lib in JAXP

Reviewed-by: lancea, alanb
This commit is contained in:
Joe Wang 2015-03-05 17:18:19 -08:00
parent cd16fed9b8
commit a953097a89
10 changed files with 356 additions and 201 deletions

View file

@ -23,7 +23,7 @@
*/
/*
* Copyright (c) 2009, 2013, by Oracle Corporation. All Rights Reserved.
* Copyright (c) 2009, 2015, by Oracle Corporation. All Rights Reserved.
*/
package javax.xml.stream;
@ -70,19 +70,34 @@ public abstract class XMLEventFactory {
* This static method creates a new factory instance.
* This method uses the following ordered lookup procedure to determine
* the XMLEventFactory implementation class to load:
* </p>
* <p>
* <ul>
* <li>
* Use the javax.xml.stream.XMLEventFactory system property.
* </li>
* <li>
* Use the properties file "lib/stax.properties" in the JRE directory.
* This configuration file is in standard java.util.Properties format
* and contains the fully qualified name of the implementation class
* with the key being the system property defined above.
* <p>
* Use the configuration file "stax.properties". The file is in standard
* {@link java.util.Properties} format and typically located in the
* {@code conf} directory of the Java installation. It contains the fully qualified
* name of the implementation class with the key being the system property
* defined above.
*
* <p>
* The stax.properties file is read only once by the implementation
* and its values are then cached for future use. If the file does not exist
* when the first attempt is made to read from it, no further attempts are
* made to check for its existence. It is not possible to change the value
* of any property in stax.properties after it has been read for the first time.
*
* <p>
* Use the jaxp configuration file "jaxp.properties". The file is in the same
* format as stax.properties and will only be read if stax.properties does
* not exist.
* </li>
* <li>
* Use the service-provider loading facilities, defined by the
* <p>
* Use the service-provider loading facility, defined by the
* {@link java.util.ServiceLoader} class, to attempt to locate and load an
* implementation of the service using the {@linkplain
* java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}:
@ -93,18 +108,18 @@ public abstract class XMLEventFactory {
* ClassLoader#getSystemClassLoader() system class loader} will be used.
* </li>
* <li>
* <p>
* Otherwise, the system-default implementation is returned.
* </li>
* </ul>
* <p>
* Once an application has obtained a reference to a XMLEventFactory it
* can use the factory to configure and obtain stream instances.
* </p>
* <p>
* Note that this is a new method that replaces the deprecated newInstance() method.
* No changes in behavior are defined by this replacement method relative to
* the deprecated method.
* </p>
*
* @throws FactoryConfigurationError in case of {@linkplain
* java.util.ServiceConfigurationError service configuration error} or if
* the implementation is not available or cannot be instantiated.
@ -143,20 +158,35 @@ public abstract class XMLEventFactory {
* <p>
* This method uses the following ordered lookup procedure to determine
* the XMLEventFactory implementation class to load:
* </p>
* <p>
* <ul>
* <li>
* Use the value of the system property identified by {@code factoryId}.
* </li>
* <li>
* Use the properties file "lib/stax.properties" in the JRE directory.
* This configuration file is in standard java.util.Properties format
* and contains the fully qualified name of the implementation class
* with the key being the given {@code factoryId}.
* <p>
* Use the configuration file "stax.properties". The file is in standard
* {@link java.util.Properties} format and typically located in the
* conf directory of the Java installation. It contains the fully qualified
* name of the implementation class with the key being the system property
* defined above.
*
* <p>
* The stax.properties file is read only once by the implementation
* and its values are then cached for future use. If the file does not exist
* when the first attempt is made to read from it, no further attempts are
* made to check for its existence. It is not possible to change the value
* of any property in stax.properties after it has been read for the first time.
*
* <p>
* Use the jaxp configuration file "jaxp.properties". The file is in the same
* format as stax.properties and will only be read if stax.properties does
* not exist.
* </li>
* <li>
* <p>
* If {@code factoryId} is "javax.xml.stream.XMLEventFactory",
* use the service-provider loading facilities, defined by the
* use the service-provider loading facility, defined by the
* {@link java.util.ServiceLoader} class, to attempt to {@linkplain
* java.util.ServiceLoader#load(java.lang.Class, java.lang.ClassLoader) locate and load}
* an implementation of the service using the specified {@code ClassLoader}.
@ -169,6 +199,7 @@ public abstract class XMLEventFactory {
* ClassLoader#getSystemClassLoader() system class loader} will be used.
* </li>
* <li>
* <p>
* Otherwise, throws a {@link FactoryConfigurationError}.
* </li>
* </ul>
@ -179,7 +210,6 @@ public abstract class XMLEventFactory {
* newInstance(String factoryId, ClassLoader classLoader)} method.
* No changes in behavior are defined by this replacement method relative
* to the deprecated method.
* </p>
*
* @apiNote The parameter factoryId defined here is inconsistent with that
* of other JAXP factories where the first parameter is fully qualified

View file

@ -68,7 +68,7 @@ import javax.xml.transform.Source;
*
*
* @version 1.2
* @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
* @author Copyright (c) 2009, 2015 by Oracle Corporation. All Rights Reserved.
* @see XMLOutputFactory
* @see XMLEventReader
* @see XMLStreamReader
@ -163,16 +163,28 @@ public abstract class XMLInputFactory {
* </p>
* <ul>
* <li>
* Use the javax.xml.stream.XMLInputFactory system property.
* <p>Use the javax.xml.stream.XMLInputFactory system property.
* </li>
* <li>
* Use the properties file "lib/stax.properties" in the JRE directory.
* This configuration file is in standard java.util.Properties format
* and contains the fully qualified name of the implementation class
* with the key being the system property defined above.
* <p>Use the configuration file "stax.properties". The file is in standard
* {@link java.util.Properties} format and typically located in the
* {@code conf} directory of the Java installation. It contains the fully qualified
* name of the implementation class with the key being the system property
* defined above.
*
* <p>The stax.properties file is read only once by the implementation
* and its values are then cached for future use. If the file does not exist
* when the first attempt is made to read from it, no further attempts are
* made to check for its existence. It is not possible to change the value
* of any property in stax.properties after it has been read for the first time.
*
* <p>
* Use the jaxp configuration file "jaxp.properties". The file is in the same
* format as stax.properties and will only be read if stax.properties does
* not exist.
* </li>
* <li>
* Use the service-provider loading facilities, defined by the
* <p>Use the service-provider loading facility, defined by the
* {@link java.util.ServiceLoader} class, to attempt to locate and load an
* implementation of the service using the {@linkplain
* java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}:
@ -183,7 +195,7 @@ public abstract class XMLInputFactory {
* ClassLoader#getSystemClassLoader() system class loader} will be used.
* </li>
* <li>
* Otherwise, the system-default implementation is returned.
* <p>Otherwise, the system-default implementation is returned.
* </li>
* </ul>
* <p>
@ -233,20 +245,36 @@ public abstract class XMLInputFactory {
* <p>
* This method uses the following ordered lookup procedure to determine
* the XMLInputFactory implementation class to load:
* </p>
* <p>
* <ul>
* <li>
* <p>
* Use the value of the system property identified by {@code factoryId}.
* </li>
* <li>
* Use the properties file "lib/stax.properties" in the JRE directory.
* This configuration file is in standard java.util.Properties format
* and contains the fully qualified name of the implementation class
* with the key being the given {@code factoryId}.
* <p>
* Use the configuration file "stax.properties". The file is in standard
* {@link java.util.Properties} format and typically located in the
* {@code conf} directory of the Java installation. It contains the fully qualified
* name of the implementation class with the key being the system property
* defined above.
*
* <p>
* The stax.properties file is read only once by the implementation
* and its values are then cached for future use. If the file does not exist
* when the first attempt is made to read from it, no further attempts are
* made to check for its existence. It is not possible to change the value
* of any property in stax.properties after it has been read for the first time.
*
* <p>
* Use the jaxp configuration file "jaxp.properties". The file is in the same
* format as stax.properties and will only be read if stax.properties does
* not exist.
* </li>
* <li>
* <p>
* If {@code factoryId} is "javax.xml.stream.XMLInputFactory",
* use the service-provider loading facilities, defined by the
* use the service-provider loading facility, defined by the
* {@link java.util.ServiceLoader} class, to attempt to {@linkplain
* java.util.ServiceLoader#load(java.lang.Class, java.lang.ClassLoader) locate and load}
* an implementation of the service using the specified {@code ClassLoader}.
@ -259,6 +287,7 @@ public abstract class XMLInputFactory {
* ClassLoader#getSystemClassLoader() system class loader} will be used.
* </li>
* <li>
* <p>
* Otherwise, throws a {@link FactoryConfigurationError}.
* </li>
* </ul>
@ -269,7 +298,7 @@ public abstract class XMLInputFactory {
* newInstance(String factoryId, ClassLoader classLoader)} method.
* No changes in behavior are defined by this replacement method relative
* to the deprecated method.
* </p>
*
*
* @apiNote The parameter factoryId defined here is inconsistent with that
* of other JAXP factories where the first parameter is fully qualified

View file

@ -102,7 +102,7 @@ import javax.xml.transform.Result;
* namespace URI of the element or attribute using that prefix.</p>
*
* @version 1.2
* @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
* @author Copyright (c) 2009, 2015 by Oracle Corporation. All Rights Reserved.
* @see XMLInputFactory
* @see XMLEventWriter
* @see XMLStreamWriter
@ -136,19 +136,34 @@ public abstract class XMLOutputFactory {
* This static method creates a new factory instance. This method uses the
* following ordered lookup procedure to determine the XMLOutputFactory
* implementation class to load:
* </p>
* <p>
* <ul>
* <li>
* Use the javax.xml.stream.XMLOutputFactory system property.
* </li>
* <li>
* Use the properties file "lib/stax.properties" in the JRE directory.
* This configuration file is in standard java.util.Properties format
* and contains the fully qualified name of the implementation class
* with the key being the system property defined above.
* <p>
* Use the configuration file "stax.properties". The file is in standard
* {@link java.util.Properties} format and typically located in the
* {@code conf} directory of the Java installation. It contains the fully qualified
* name of the implementation class with the key being the system property
* defined above.
*
* <p>
* The stax.properties file is read only once by the implementation
* and its values are then cached for future use. If the file does not exist
* when the first attempt is made to read from it, no further attempts are
* made to check for its existence. It is not possible to change the value
* of any property in stax.properties after it has been read for the first time.
*
* <p>
* Use the jaxp configuration file "jaxp.properties". The file is in the same
* format as stax.properties and will only be read if stax.properties does
* not exist.
* </li>
* <li>
* Use the service-provider loading facilities, defined by the
* <p>
* Use the service-provider loading facility, defined by the
* {@link java.util.ServiceLoader} class, to attempt to locate and load an
* implementation of the service using the {@linkplain
* java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}:
@ -159,17 +174,17 @@ public abstract class XMLOutputFactory {
* ClassLoader#getSystemClassLoader() system class loader} will be used.
* </li>
* <li>
* <p>
* Otherwise, the system-default implementation is returned.
* </li>
* <p>
* Once an application has obtained a reference to a XMLOutputFactory it
* can use the factory to configure and obtain stream instances.
* </p>
* <p>
* Note that this is a new method that replaces the deprecated newInstance() method.
* No changes in behavior are defined by this replacement method relative to the
* deprecated method.
* </p>
*
* @throws FactoryConfigurationError in case of {@linkplain
* java.util.ServiceConfigurationError service configuration error} or if
* the implementation is not available or cannot be instantiated.
@ -207,20 +222,35 @@ public abstract class XMLOutputFactory {
* <p>
* This method uses the following ordered lookup procedure to determine
* the XMLOutputFactory implementation class to load:
* </p>
* <p>
* <ul>
* <li>
* Use the value of the system property identified by {@code factoryId}.
* </li>
* <li>
* Use the properties file "lib/stax.properties" in the JRE directory.
* This configuration file is in standard java.util.Properties format
* and contains the fully qualified name of the implementation class
* with the key being the given {@code factoryId}.
* <p>
* Use the configuration file "stax.properties". The file is in standard
* {@link java.util.Properties} format and typically located in the
* {@code conf} directory of the Java installation. It contains the fully qualified
* name of the implementation class with the key being the system property
* defined above.
*
* <p>
* The stax.properties file is read only once by the implementation
* and its values are then cached for future use. If the file does not exist
* when the first attempt is made to read from it, no further attempts are
* made to check for its existence. It is not possible to change the value
* of any property in stax.properties after it has been read for the first time.
*
* <p>
* Use the jaxp configuration file "jaxp.properties". The file is in the same
* format as stax.properties and will only be read if stax.properties does
* not exist.
* </li>
* <li>
* <p>
* If {@code factoryId} is "javax.xml.stream.XMLOutputFactory",
* use the service-provider loading facilities, defined by the
* use the service-provider loading facility, defined by the
* {@link java.util.ServiceLoader} class, to attempt to {@linkplain
* java.util.ServiceLoader#load(java.lang.Class, java.lang.ClassLoader) locate and load}
* an implementation of the service using the specified {@code ClassLoader}.
@ -233,6 +263,7 @@ public abstract class XMLOutputFactory {
* ClassLoader#getSystemClassLoader() system class loader} will be used.
* </li>
* <li>
* <p>
* Otherwise, throws a {@link FactoryConfigurationError}.
* </li>
* </ul>
@ -246,7 +277,7 @@ public abstract class XMLOutputFactory {
* {@link #newInstance(java.lang.String, java.lang.ClassLoader)
* newInstance(String factoryId, ClassLoader classLoader)} method.
* The original method was incorrectly defined to return XMLInputFactory.
* </p>
*
*
* @param factoryId Name of the factory to find, same as
* a property name