Make sure we don't create an XMLStreamReader if there isn't an XMLReader

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

Branch: refs/heads/2.6.x-fixes
Commit: 31999f8bf338f3db16201ebb53286c82b932fa2c
Parents: bf410ab
Author: Daniel Kulp <[email protected]>
Authored: Wed Mar 26 15:35:12 2014 -0400
Committer: Daniel Kulp <[email protected]>
Committed: Fri Apr 4 12:02:51 2014 -0400

----------------------------------------------------------------------
 api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/31999f8b/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java 
b/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
index 294539b..ebcf989 100644
--- a/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
+++ b/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
@@ -1482,7 +1482,10 @@ public final class StaxUtils {
             } else if (source instanceof StaxSource) {
                 return ((StaxSource)source).getXMLStreamReader();
             } else if (source instanceof SAXSource) {
-                return 
createXMLStreamReader(((SAXSource)source).getInputSource());
+                SAXSource ss = (SAXSource)source;
+                if (ss.getXMLReader() == null) {
+                    return 
createXMLStreamReader(((SAXSource)source).getInputSource());
+                }
             }
             
             XMLInputFactory factory = getXMLInputFactory();

Reply via email to