You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2008/04/06 10:03:19 UTC

svn commit: r645211 - /xerces/java/trunk/samples/xni/ObjectFactory.java

Author: mrglavas
Date: Sun Apr  6 01:03:15 2008
New Revision: 645211

URL: http://svn.apache.org/viewvc?rev=645211&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/samples/xni/ObjectFactory.java

Modified: xerces/java/trunk/samples/xni/ObjectFactory.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/samples/xni/ObjectFactory.java?rev=645211&r1=645210&r2=645211&view=diff
==============================================================================
--- xerces/java/trunk/samples/xni/ObjectFactory.java (original)
+++ xerces/java/trunk/samples/xni/ObjectFactory.java Sun Apr  6 01:03:15 2008
@@ -135,7 +135,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: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org