Author: mrglavas
Date: Wed Mar 17 14:36:47 2010
New Revision: 924310
URL: http://svn.apache.org/viewvc?rev=924310&view=rev
Log:
Allow the debug flag in ObjectFactory to be configured with a system property
(called xerces.debug) to make it easier for applications to troubleshoot the
discovery and loading of XMLParserConfigurations.
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/html/dom/ObjectFactory.java
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/ObjectFactory.java
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/ObjectFactory.java
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/parsers/ObjectFactory.java
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xinclude/ObjectFactory.java
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xml/serialize/ObjectFactory.java
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/html/dom/ObjectFactory.java
URL:
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/html/dom/ObjectFactory.java?rev=924310&r1=924309&r2=924310&view=diff
==============================================================================
---
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/html/dom/ObjectFactory.java
(original)
+++
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/html/dom/ObjectFactory.java
Wed Mar 17 14:36:47 2010
@@ -51,7 +51,7 @@ final class ObjectFactory {
private static final String DEFAULT_PROPERTIES_FILENAME =
"xerces.properties";
/** Set to true for debugging */
- private static final boolean DEBUG = false;
+ private static final boolean DEBUG = isDebugEnabled();
/**
* Default columns per line.
@@ -255,11 +255,22 @@ final class ObjectFactory {
//
// Private static methods
//
+
+ /** Returns true if debug has been enabled. */
+ private static boolean isDebugEnabled() {
+ try {
+ String val = SecuritySupport.getSystemProperty("xerces.debug");
+ // Allow simply setting the prop to turn on debug
+ return (val != null && (!"false".equals(val)));
+ }
+ catch (SecurityException se) {}
+ return false;
+ } // isDebugEnabled()
/** Prints a message to standard error if debugging is enabled. */
private static void debugPrintln(String msg) {
if (DEBUG) {
- System.err.println("JAXP: " + msg);
+ System.err.println("XERCES: " + msg);
}
} // debugPrintln(String)
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/ObjectFactory.java
URL:
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/ObjectFactory.java?rev=924310&r1=924309&r2=924310&view=diff
==============================================================================
---
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/ObjectFactory.java
(original)
+++
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/ObjectFactory.java
Wed Mar 17 14:36:47 2010
@@ -51,7 +51,7 @@ final class ObjectFactory {
private static final String DEFAULT_PROPERTIES_FILENAME =
"xerces.properties";
/** Set to true for debugging */
- private static final boolean DEBUG = false;
+ private static final boolean DEBUG = isDebugEnabled();
/**
* Default columns per line.
@@ -255,11 +255,22 @@ final class ObjectFactory {
//
// Private static methods
//
+
+ /** Returns true if debug has been enabled. */
+ private static boolean isDebugEnabled() {
+ try {
+ String val = SecuritySupport.getSystemProperty("xerces.debug");
+ // Allow simply setting the prop to turn on debug
+ return (val != null && (!"false".equals(val)));
+ }
+ catch (SecurityException se) {}
+ return false;
+ } // isDebugEnabled()
/** Prints a message to standard error if debugging is enabled. */
private static void debugPrintln(String msg) {
if (DEBUG) {
- System.err.println("JAXP: " + msg);
+ System.err.println("XERCES: " + msg);
}
} // debugPrintln(String)
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/ObjectFactory.java
URL:
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/ObjectFactory.java?rev=924310&r1=924309&r2=924310&view=diff
==============================================================================
---
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/ObjectFactory.java
(original)
+++
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/ObjectFactory.java
Wed Mar 17 14:36:47 2010
@@ -51,7 +51,7 @@ final class ObjectFactory {
private static final String DEFAULT_PROPERTIES_FILENAME =
"xerces.properties";
/** Set to true for debugging */
- private static final boolean DEBUG = false;
+ private static final boolean DEBUG = isDebugEnabled();
/**
* Default columns per line.
@@ -255,11 +255,22 @@ final class ObjectFactory {
//
// Private static methods
//
+
+ /** Returns true if debug has been enabled. */
+ private static boolean isDebugEnabled() {
+ try {
+ String val = SecuritySupport.getSystemProperty("xerces.debug");
+ // Allow simply setting the prop to turn on debug
+ return (val != null && (!"false".equals(val)));
+ }
+ catch (SecurityException se) {}
+ return false;
+ } // isDebugEnabled()
/** Prints a message to standard error if debugging is enabled. */
private static void debugPrintln(String msg) {
if (DEBUG) {
- System.err.println("JAXP: " + msg);
+ System.err.println("XERCES: " + msg);
}
} // debugPrintln(String)
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/parsers/ObjectFactory.java
URL:
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/parsers/ObjectFactory.java?rev=924310&r1=924309&r2=924310&view=diff
==============================================================================
---
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/parsers/ObjectFactory.java
(original)
+++
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/parsers/ObjectFactory.java
Wed Mar 17 14:36:47 2010
@@ -49,7 +49,7 @@ final class ObjectFactory {
private static final String DEFAULT_PROPERTIES_FILENAME =
"xerces.properties";
/** Set to true for debugging */
- private static final boolean DEBUG = false;
+ private static final boolean DEBUG = isDebugEnabled();
/**
* Default columns per line.
@@ -253,11 +253,22 @@ final class ObjectFactory {
//
// Private static methods
//
+
+ /** Returns true if debug has been enabled. */
+ private static boolean isDebugEnabled() {
+ try {
+ String val = SecuritySupport.getSystemProperty("xerces.debug");
+ // Allow simply setting the prop to turn on debug
+ return (val != null && (!"false".equals(val)));
+ }
+ catch (SecurityException se) {}
+ return false;
+ } // isDebugEnabled()
/** Prints a message to standard error if debugging is enabled. */
private static void debugPrintln(String msg) {
if (DEBUG) {
- System.err.println("JAXP: " + msg);
+ System.err.println("XERCES: " + msg);
}
} // debugPrintln(String)
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xinclude/ObjectFactory.java
URL:
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xinclude/ObjectFactory.java?rev=924310&r1=924309&r2=924310&view=diff
==============================================================================
---
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xinclude/ObjectFactory.java
(original)
+++
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xinclude/ObjectFactory.java
Wed Mar 17 14:36:47 2010
@@ -49,7 +49,7 @@ final class ObjectFactory {
private static final String DEFAULT_PROPERTIES_FILENAME =
"xerces.properties";
/** Set to true for debugging */
- private static final boolean DEBUG = false;
+ private static final boolean DEBUG = isDebugEnabled();
/**
* Default columns per line.
@@ -253,11 +253,22 @@ final class ObjectFactory {
//
// Private static methods
//
+
+ /** Returns true if debug has been enabled. */
+ private static boolean isDebugEnabled() {
+ try {
+ String val = SecuritySupport.getSystemProperty("xerces.debug");
+ // Allow simply setting the prop to turn on debug
+ return (val != null && (!"false".equals(val)));
+ }
+ catch (SecurityException se) {}
+ return false;
+ } // isDebugEnabled()
/** Prints a message to standard error if debugging is enabled. */
private static void debugPrintln(String msg) {
if (DEBUG) {
- System.err.println("JAXP: " + msg);
+ System.err.println("XERCES: " + msg);
}
} // debugPrintln(String)
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xml/serialize/ObjectFactory.java
URL:
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xml/serialize/ObjectFactory.java?rev=924310&r1=924309&r2=924310&view=diff
==============================================================================
---
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xml/serialize/ObjectFactory.java
(original)
+++
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xml/serialize/ObjectFactory.java
Wed Mar 17 14:36:47 2010
@@ -49,7 +49,7 @@ final class ObjectFactory {
private static final String DEFAULT_PROPERTIES_FILENAME =
"xerces.properties";
/** Set to true for debugging */
- private static final boolean DEBUG = false;
+ private static final boolean DEBUG = isDebugEnabled();
/**
* Default columns per line.
@@ -253,11 +253,22 @@ final class ObjectFactory {
//
// Private static methods
//
+
+ /** Returns true if debug has been enabled. */
+ private static boolean isDebugEnabled() {
+ try {
+ String val = SecuritySupport.getSystemProperty("xerces.debug");
+ // Allow simply setting the prop to turn on debug
+ return (val != null && (!"false".equals(val)));
+ }
+ catch (SecurityException se) {}
+ return false;
+ } // isDebugEnabled()
/** Prints a message to standard error if debugging is enabled. */
private static void debugPrintln(String msg) {
if (DEBUG) {
- System.err.println("JAXP: " + msg);
+ System.err.println("XERCES: " + msg);
}
} // debugPrintln(String)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]