Author: mrglavas
Date: Sun Apr 6 01:00:17 2008
New Revision: 645208
URL: http://svn.apache.org/viewvc?rev=645208&view=rev
Log:
If an application wants to clear a property they're out of luck unless
they use Java 5.0 or above (see System.clearProperty()). The closest
thing they can do is set the value to the empty string. Instead of
making a futile attempt to create an instance of a class named "" we
treat it as if it were null (i.e. cleared) and then move on to the
next step in the factory lookup.
Modified:
xerces/java/trunk/src/org/apache/html/dom/ObjectFactory.java
xerces/java/trunk/src/org/apache/xerces/dom/ObjectFactory.java
xerces/java/trunk/src/org/apache/xerces/impl/dv/ObjectFactory.java
xerces/java/trunk/src/org/apache/xerces/parsers/ObjectFactory.java
xerces/java/trunk/src/org/apache/xerces/xinclude/ObjectFactory.java
xerces/java/trunk/src/org/apache/xml/serialize/ObjectFactory.java
Modified: xerces/java/trunk/src/org/apache/html/dom/ObjectFactory.java
URL:
http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/html/dom/ObjectFactory.java?rev=645208&r1=645207&r2=645208&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/html/dom/ObjectFactory.java (original)
+++ xerces/java/trunk/src/org/apache/html/dom/ObjectFactory.java Sun Apr 6
01:00:17 2008
@@ -134,7 +134,7 @@
// Use the system property first
try {
String systemProp = SecuritySupport.getSystemProperty(factoryId);
- if (systemProp != null) {
+ if (systemProp != null && systemProp.length() > 0) {
if (DEBUG) debugPrintln("found system property, value=" +
systemProp);
return newInstance(systemProp, cl, true);
}
Modified: xerces/java/trunk/src/org/apache/xerces/dom/ObjectFactory.java
URL:
http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/dom/ObjectFactory.java?rev=645208&r1=645207&r2=645208&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/dom/ObjectFactory.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/dom/ObjectFactory.java Sun Apr 6
01:00:17 2008
@@ -134,7 +134,7 @@
// Use the system property first
try {
String systemProp = SecuritySupport.getSystemProperty(factoryId);
- if (systemProp != null) {
+ if (systemProp != null && systemProp.length() > 0) {
if (DEBUG) debugPrintln("found system property, value=" +
systemProp);
return newInstance(systemProp, cl, true);
}
Modified: xerces/java/trunk/src/org/apache/xerces/impl/dv/ObjectFactory.java
URL:
http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/dv/ObjectFactory.java?rev=645208&r1=645207&r2=645208&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/dv/ObjectFactory.java
(original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/dv/ObjectFactory.java Sun Apr
6 01:00:17 2008
@@ -134,7 +134,7 @@
// Use the system property first
try {
String systemProp = SecuritySupport.getSystemProperty(factoryId);
- if (systemProp != null) {
+ if (systemProp != null && systemProp.length() > 0) {
if (DEBUG) debugPrintln("found system property, value=" +
systemProp);
return newInstance(systemProp, cl, true);
}
Modified: xerces/java/trunk/src/org/apache/xerces/parsers/ObjectFactory.java
URL:
http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/parsers/ObjectFactory.java?rev=645208&r1=645207&r2=645208&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/parsers/ObjectFactory.java
(original)
+++ xerces/java/trunk/src/org/apache/xerces/parsers/ObjectFactory.java Sun Apr
6 01:00:17 2008
@@ -132,7 +132,7 @@
// Use the system property first
try {
String systemProp = SecuritySupport.getSystemProperty(factoryId);
- if (systemProp != null) {
+ if (systemProp != null && systemProp.length() > 0) {
if (DEBUG) debugPrintln("found system property, value=" +
systemProp);
return newInstance(systemProp, cl, true);
}
Modified: xerces/java/trunk/src/org/apache/xerces/xinclude/ObjectFactory.java
URL:
http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/xinclude/ObjectFactory.java?rev=645208&r1=645207&r2=645208&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/xinclude/ObjectFactory.java
(original)
+++ xerces/java/trunk/src/org/apache/xerces/xinclude/ObjectFactory.java Sun Apr
6 01:00:17 2008
@@ -132,7 +132,7 @@
// Use the system property first
try {
String systemProp = SecuritySupport.getSystemProperty(factoryId);
- if (systemProp != null) {
+ if (systemProp != null && systemProp.length() > 0) {
if (DEBUG) debugPrintln("found system property, value=" +
systemProp);
return newInstance(systemProp, cl, true);
}
Modified: xerces/java/trunk/src/org/apache/xml/serialize/ObjectFactory.java
URL:
http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xml/serialize/ObjectFactory.java?rev=645208&r1=645207&r2=645208&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xml/serialize/ObjectFactory.java (original)
+++ xerces/java/trunk/src/org/apache/xml/serialize/ObjectFactory.java Sun Apr
6 01:00:17 2008
@@ -132,7 +132,7 @@
// Use the system property first
try {
String systemProp = SecuritySupport.getSystemProperty(factoryId);
- if (systemProp != null) {
+ if (systemProp != null && systemProp.length() > 0) {
if (DEBUG) debugPrintln("found system property, value=" +
systemProp);
return newInstance(systemProp, cl, true);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]