cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-6918] Better error processing when creating XMLInputFactory, patch from Svetlin Zarev applied with thanks
Date Wed, 08 Jun 2016 11:02:53 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 53d3867cd -> 7fe5982b6


[CXF-6918] Better error processing when creating XMLInputFactory, patch from Svetlin Zarev
applied with thanks


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/7fe5982b
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/7fe5982b
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/7fe5982b

Branch: refs/heads/master
Commit: 7fe5982b62fb1872c3fa23a58dc4c0021903e7f8
Parents: 53d3867
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Wed Jun 8 12:02:38 2016 +0100
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Wed Jun 8 12:02:38 2016 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/cxf/staxutils/StaxUtils.java   | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/7fe5982b/core/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/staxutils/StaxUtils.java b/core/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
index 6b0eb42..0d2398d 100644
--- a/core/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
+++ b/core/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
@@ -308,14 +308,24 @@ public final class StaxUtils {
         try {
             factory = XMLInputFactory.newInstance();
         } catch (Throwable t) {
+            if (LOG.isLoggable(Level.FINE)) {
+                LOG.log(Level.FINE, "XMLInputFactory.newInstance() failed with: ", t);
+            }
             factory = null;
         }
         if (factory == null || !setRestrictionProperties(factory)) {
             try {
                 factory = createWoodstoxFactory();
             } catch (Throwable t) {
-                //ignore for now
+                if (LOG.isLoggable(Level.FINE)) {
+                    LOG.log(Level.FINE, "Cannot create Woodstox XMLInputFactory: ", t);
+                }
             }
+            
+            if (factory == null) {
+                throw new RuntimeException("Failed to create XMLInputFactory.");
+            }
+            
             if (!setRestrictionProperties(factory)) {
                 if (allowInsecureParser) {
                     LOG.log(Level.WARNING, "INSECURE_PARSER_DETECTED", factory.getClass().getName());


Mime
View raw message