Author: mrglavas
Date: Sun Apr  6 01:01:17 2008
New Revision: 645210

URL: http://svn.apache.org/viewvc?rev=645210&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/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=645210&r1=645209&r2=645210&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
 Sun Apr  6 01:01: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/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=645210&r1=645209&r2=645210&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
 Sun Apr  6 01:01: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/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=645210&r1=645209&r2=645210&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
 Sun Apr  6 01:01: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/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=645210&r1=645209&r2=645210&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
 Sun Apr  6 01:01: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/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=645210&r1=645209&r2=645210&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
 Sun Apr  6 01:01: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/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=645210&r1=645209&r2=645210&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
 Sun Apr  6 01:01: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]

Reply via email to