From 41208535c47fa47cb8b4bbf49caa1215b45c94ec Mon Sep 17 00:00:00 2001 From: edwingo Date: Wed, 24 Oct 2001 01:12:42 +0000 Subject: [PATCH] Clean up debug code git-svn-id: https://svn.apache.org/repos/asf/xml/commons/trunk@225929 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/javax/xml/parsers/FactoryFinder.java | 18 +++++------------- .../src/javax/xml/transform/FactoryFinder.java | 18 +++++------------- 2 files changed, 10 insertions(+), 26 deletions(-) diff --git a/java/external/src/javax/xml/parsers/FactoryFinder.java b/java/external/src/javax/xml/parsers/FactoryFinder.java index 423c204..c35400d 100644 --- a/java/external/src/javax/xml/parsers/FactoryFinder.java +++ b/java/external/src/javax/xml/parsers/FactoryFinder.java @@ -78,16 +78,8 @@ import java.lang.reflect.InvocationTargetException; * when bundled as part of the JDK. */ class FactoryFinder { - /** Temp debug code - this will be removed after we test everything - */ - private static boolean debug = false; - static { - // Use try/catch block to support applets - try { - debug = System.getProperty("jaxp.debug") != null; - } catch (Exception x) { - } - } + /** Set to true for debugging */ + private static final boolean debug = false; private static void debugPrintln(String msg) { if (debug) { @@ -108,9 +100,7 @@ class FactoryFinder { m = Thread.class.getMethod("getContextClassLoader", null); } catch (NoSuchMethodException e) { // Assume that we are running JDK 1.1, use the current ClassLoader - if (debug) { - debugPrintln("assuming JDK 1.1"); - } + debugPrintln("assuming JDK 1.1"); return FactoryFinder.class.getClassLoader(); } @@ -169,6 +159,8 @@ class FactoryFinder { static Object find(String factoryId, String fallbackClassName) throws ConfigurationError { + debugPrintln("debug is on"); + ClassLoader classLoader = findClassLoader(); // Use the system property first diff --git a/java/external/src/javax/xml/transform/FactoryFinder.java b/java/external/src/javax/xml/transform/FactoryFinder.java index 0b579e1..8babbe6 100644 --- a/java/external/src/javax/xml/transform/FactoryFinder.java +++ b/java/external/src/javax/xml/transform/FactoryFinder.java @@ -78,16 +78,8 @@ import java.lang.reflect.InvocationTargetException; * when bundled as part of the JDK. */ class FactoryFinder { - /** Temp debug code - this will be removed after we test everything - */ - private static boolean debug = false; - static { - // Use try/catch block to support applets - try { - debug = System.getProperty("jaxp.debug") != null; - } catch (Exception x) { - } - } + /** Set to true for debugging */ + private static final boolean debug = false; private static void debugPrintln(String msg) { if (debug) { @@ -108,9 +100,7 @@ class FactoryFinder { m = Thread.class.getMethod("getContextClassLoader", null); } catch (NoSuchMethodException e) { // Assume that we are running JDK 1.1, use the current ClassLoader - if (debug) { - debugPrintln("assuming JDK 1.1"); - } + debugPrintln("assuming JDK 1.1"); return FactoryFinder.class.getClassLoader(); } @@ -169,6 +159,8 @@ class FactoryFinder { static Object find(String factoryId, String fallbackClassName) throws ConfigurationError { + debugPrintln("debug is on"); + ClassLoader classLoader = findClassLoader(); // Use the system property first