cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1460772 - /cxf/trunk/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
Date Mon, 25 Mar 2013 17:34:28 GMT
Author: dkulp
Date: Mon Mar 25 17:34:28 2013
New Revision: 1460772

URL: http://svn.apache.org/r1460772
Log:
If cannot create a parser factory at startup, allow trying at runtime.

Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java?rev=1460772&r1=1460771&r2=1460772&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java Mon Mar 25 17:34:28
2013
@@ -163,14 +163,19 @@ public final class StaxUtils {
             allowInsecureParser = "1".equals(s) || Boolean.parseBoolean(s);
         }
         
-        XMLInputFactory xif = createXMLInputFactory(true);
-        String xifClassName = xif.getClass().getName();
-        if (xifClassName.contains("ctc.wstx") || xifClassName.contains("xml.xlxp")
-                || xifClassName.contains("xml.xlxp2") || xifClassName.contains("bea.core"))
{
-            SAFE_INPUT_FACTORY = xif;
-        } else {
-            SAFE_INPUT_FACTORY = null;
+        XMLInputFactory xif = null;
+        try {
+            xif = createXMLInputFactory(true);
+            String xifClassName = xif.getClass().getName();
+            if (!xifClassName.contains("ctc.wstx") && !xifClassName.contains("xml.xlxp")
+                    && !xifClassName.contains("xml.xlxp2") && !xifClassName.contains("bea.core"))
{
+                xif = null;
+            }
+        } catch (Throwable t) {
+            //ignore, can always drop down to the pooled factories
+            xif = null;
         }
+        SAFE_INPUT_FACTORY = xif;
         
         XMLOutputFactory xof = XMLOutputFactory.newInstance();
         String xofClassName = xof.getClass().getName();



Mime
View raw message