< prev index next >
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/utils/ObjectFactory.java
Print this page
@@ -18,10 +18,12 @@
* limitations under the License.
*/
package com.sun.org.apache.xerces.internal.utils;
+import java.util.function.Supplier;
+
/**
* This class is duplicated for each JAXP subpackage so keep it in sync.
* It is package private and therefore is not exposed as part of the JAXP
* API.
* <p>
@@ -59,13 +61,13 @@
catch (SecurityException se) {}
return false;
} // isDebugEnabled()
/** Prints a message to standard error if debugging is enabled. */
- private static void debugPrintln(String msg) {
+ private static void debugPrintln(Supplier<String> msgGen) {
if (DEBUG) {
- System.err.println("XERCES: " + msg);
+ System.err.println("XERCES: " + msgGen.get());
}
} // debugPrintln(String)
/**
* Figure out which ClassLoader to use. For JDK 1.2 and later use
@@ -153,11 +155,11 @@
{
// assert(className != null);
try{
Class providerClass = findProviderClass(className, cl, doFallback);
Object instance = providerClass.newInstance();
- if (DEBUG) debugPrintln("created new instance of " + providerClass +
+ debugPrintln(()->"created new instance of " + providerClass +
" using ClassLoader: " + cl);
return instance;
} catch (ClassNotFoundException x) {
throw new ConfigurationError(
"Provider " + className + " not found", x);
< prev index next >