From f3fec278eeef70bcbcd0c5a9cf3897f16e726d60 Mon Sep 17 00:00:00 2001 From: ndw Date: Wed, 13 Nov 2002 20:55:47 +0000 Subject: [PATCH] These apps still use the static CatalogManager by default; so make sure we use that manager's debug object for messages git-svn-id: https://svn.apache.org/repos/asf/xml/commons/trunk@226011 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/xml/resolver/apps/resolver.java | 16 +++++++++------- .../org/apache/xml/resolver/apps/xparse.java | 18 ++++++++++-------- .../org/apache/xml/resolver/apps/xread.java | 15 +++++++++------ 3 files changed, 28 insertions(+), 21 deletions(-) diff --git a/java/src/org/apache/xml/resolver/apps/resolver.java b/java/src/org/apache/xml/resolver/apps/resolver.java index 73e86d7..5be7526 100644 --- a/java/src/org/apache/xml/resolver/apps/resolver.java +++ b/java/src/org/apache/xml/resolver/apps/resolver.java @@ -75,7 +75,7 @@ import javax.xml.transform.*; import javax.xml.transform.sax.SAXSource; import org.apache.xml.resolver.Catalog; -import org.apache.xml.resolver.tools.CatalogResolver; +import org.apache.xml.resolver.CatalogManager; import org.apache.xml.resolver.helpers.Debug; import org.apache.xml.resolver.tools.CatalogResolver; @@ -120,11 +120,13 @@ import org.apache.xml.resolver.tools.CatalogResolver; * * @version 1.0 */ public class resolver { + private static Debug debug = CatalogManager.getStaticManager().debug; + /** The main entry point */ public static void main (String[] args) throws FileNotFoundException, IOException { - int debug = 0; + int debuglevel = 0; Vector catalogFiles = new Vector(); int resType = 0; String resTypeStr = null; @@ -174,9 +176,9 @@ public class resolver { ++i; String debugstr = args[i]; try { - debug = Integer.parseInt(debugstr); - if (debug >= 0) { - Debug.setDebug(debug); + debuglevel = Integer.parseInt(debugstr); + if (debuglevel > 0) { + debug.setDebug(debuglevel); } } catch (Exception e) { // nop @@ -247,7 +249,7 @@ public class resolver { } catch (MalformedURLException e) { String userdir = System.getProperty("user.dir"); userdir.replace('\\', '/'); - Debug.message(1, "Malformed URL on cwd", userdir); + debug.message(1, "Malformed URL on cwd", userdir); base = null; } @@ -258,7 +260,7 @@ public class resolver { try { sysid = new URL("file:///" + systemId); } catch (MalformedURLException e2) { - Debug.message(1, "Malformed URL on system id", systemId); + debug.message(1, "Malformed URL on system id", systemId); } } } diff --git a/java/src/org/apache/xml/resolver/apps/xparse.java b/java/src/org/apache/xml/resolver/apps/xparse.java index d1a09b2..16afcd7 100644 --- a/java/src/org/apache/xml/resolver/apps/xparse.java +++ b/java/src/org/apache/xml/resolver/apps/xparse.java @@ -72,6 +72,7 @@ import javax.xml.parsers.*; import org.apache.xml.resolver.tools.ResolvingParser; import org.apache.xml.resolver.Catalog; +import org.apache.xml.resolver.CatalogManager; import org.apache.xml.resolver.helpers.Debug; /** @@ -116,18 +117,19 @@ import org.apache.xml.resolver.helpers.Debug; * * @version 1.0 */ -public class xparse -{ +public class xparse { + private static Debug debug = CatalogManager.getStaticManager().debug; + /** The main entry point */ public static void main (String[] args) throws FileNotFoundException, IOException { String xmlfile = null; - int debug = 0; + int debuglevel = 0; int maxErrs = 10; boolean nsAware = true; boolean validating = true; - boolean showWarnings = (debug > 2); + boolean showWarnings = (debuglevel > 2); boolean showErrors = true; Vector catalogFiles = new Vector(); @@ -162,10 +164,10 @@ public class xparse ++i; String debugstr = args[i]; try { - debug = Integer.parseInt(debugstr); - if (debug >= 0) { - Debug.setDebug(debug); - showWarnings = (debug > 2); + debuglevel = Integer.parseInt(debugstr); + if (debuglevel >= 0) { + debug.setDebug(debuglevel); + showWarnings = (debuglevel > 2); } } catch (Exception e) { // nop diff --git a/java/src/org/apache/xml/resolver/apps/xread.java b/java/src/org/apache/xml/resolver/apps/xread.java index 4434601..42b4326 100644 --- a/java/src/org/apache/xml/resolver/apps/xread.java +++ b/java/src/org/apache/xml/resolver/apps/xread.java @@ -72,6 +72,7 @@ import javax.xml.parsers.*; import org.apache.xml.resolver.tools.ResolvingXMLReader; import org.apache.xml.resolver.Catalog; +import org.apache.xml.resolver.CatalogManager; import org.apache.xml.resolver.helpers.Debug; /** @@ -115,16 +116,18 @@ import org.apache.xml.resolver.helpers.Debug; */ public class xread { + private static Debug debug = CatalogManager.getStaticManager().debug; + /** The main entry point */ public static void main (String[] args) throws FileNotFoundException, IOException { String xmlfile = null; - int debug = 0; + int debuglevel = 0; int maxErrs = 10; boolean nsAware = true; boolean validating = true; - boolean showWarnings = (debug > 2); + boolean showWarnings = (debuglevel > 2); boolean showErrors = true; Vector catalogFiles = new Vector(); @@ -159,10 +162,10 @@ public class xread ++i; String debugstr = args[i]; try { - debug = Integer.parseInt(debugstr); - if (debug >= 0) { - Debug.setDebug(debug); - showWarnings = (debug > 2); + debuglevel = Integer.parseInt(debugstr); + if (debuglevel >= 0) { + debug.setDebug(debuglevel); + showWarnings = (debuglevel > 2); } } catch (Exception e) { // nop