Author: veithen
Date: Tue Dec 16 07:12:17 2008
New Revision: 727064

URL: http://svn.apache.org/viewvc?rev=727064&view=rev
Log:
WSCOMMONS-394: Fixed StAXUtils#getXMLInputFactory_singleton(boolean).

Modified:
    
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/util/StAXUtils.java

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/util/StAXUtils.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/util/StAXUtils.java?rev=727064&r1=727063&r2=727064&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/util/StAXUtils.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/util/StAXUtils.java
 Tue Dec 16 07:12:17 2008
@@ -397,9 +397,14 @@
      * @return singleton XMLInputFactory loaded with the StAXUtils classloader
      */
     private static XMLInputFactory getXMLInputFactory_singleton(final boolean 
isNetworkDetached) {
- 
-        if (inputFactory == null) {
-            XMLInputFactory f = (XMLInputFactory) 
AccessController.doPrivileged(
+        XMLInputFactory f;
+        if (isNetworkDetached) {
+            f = inputNDFactory;
+        } else {
+            f = inputFactory;
+        }
+        if (f == null) {
+            f = (XMLInputFactory) AccessController.doPrivileged(
                     new PrivilegedAction() {
                         public Object run() {
                             Thread currentThread = Thread.currentThread();
@@ -419,7 +424,7 @@
                 inputFactory = f;
             }
             if (log.isDebugEnabled()) {
-                if (inputFactory != null) {
+                if (f != null) {
                     if (isNetworkDetached) {
                         log.debug("Created singleton network detached 
XMLInputFactory = " + f.getClass());
                     } else {
@@ -429,7 +434,7 @@
             }
         }
         
-        return inputFactory;
+        return f;
     }
     
     /**


Reply via email to