< prev index next >
src/java.xml/share/classes/com/sun/org/apache/xalan/internal/utils/ObjectFactory.java
Print this page
*** 21,30 ****
--- 21,32 ----
* $Id: ObjectFactory.java,v 1.2.4.1 2005/09/15 02:39:54 jeffsuttor Exp $
*/
package com.sun.org.apache.xalan.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>
*** 44,56 ****
/** Set to true for debugging */
private static final boolean DEBUG = false;
/** Prints a message to standard error if debugging is enabled. */
! private static void debugPrintln(String msg) {
if (DEBUG) {
! System.err.println("JAXP: " + msg);
}
} // debugPrintln(String)
/**
* Figure out which ClassLoader to use. For JDK 1.2 and later use
--- 46,58 ----
/** Set to true for debugging */
private static final boolean DEBUG = false;
/** Prints a message to standard error if debugging is enabled. */
! private static void debugPrintln(Supplier<String> msgGen) {
if (DEBUG) {
! System.err.println("JAXP: " + msgGen.get());
}
} // debugPrintln(String)
/**
* Figure out which ClassLoader to use. For JDK 1.2 and later use
*** 123,133 ****
{
ClassLoader cl = System.getSecurityManager()!=null ? null : findClassLoader();
try{
Class providerClass = findProviderClass(className, cl, doFallback);
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);
--- 125,135 ----
{
ClassLoader cl = System.getSecurityManager()!=null ? null : findClassLoader();
try{
Class providerClass = findProviderClass(className, cl, doFallback);
Object instance = providerClass.newInstance();
! 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 >