cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject svn commit: r1417471 - /cxf/trunk/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
Date Wed, 05 Dec 2012 15:13:04 GMT
Author: ay
Date: Wed Dec  5 15:13:03 2012
New Revision: 1417471

URL: http://svn.apache.org/viewvc?rev=1417471&view=rev
Log:
use staxsource directly for jdk 1.6

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=1417471&r1=1417470&r2=1417471&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 Wed Dec  5 15:13:03
2012
@@ -58,6 +58,7 @@ import javax.xml.transform.Source;
 import javax.xml.transform.dom.DOMResult;
 import javax.xml.transform.dom.DOMSource;
 import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.stax.StAXSource;
 import javax.xml.transform.stream.StreamSource;
 
 import org.w3c.dom.Attr;
@@ -466,13 +467,10 @@ public final class StaxUtils {
             if (ss.getXMLStreamReader() == null) {
                 return;
             }
-        } else if ("javax.xml.transform.stax.StAXSource".equals(source.getClass().getName()))
{
-            try {
-                if (source.getClass().getMethod("getXMLStreamReader").invoke(source) == null)
{
-                    return;
-                }
-            } catch (Exception ex) {
-                //ignore
+        } else if (source instanceof StAXSource) {
+            StAXSource ss = (StAXSource)source;
+            if (ss.getXMLStreamReader() == null) {
+                return;
             }
         } else if (source instanceof SAXSource) {
             SAXSource ss = (SAXSource)source;
@@ -1314,13 +1312,8 @@ public final class StaxUtils {
                 if (null != el) {
                     return new W3CDOMStreamReader(el, source.getSystemId());
                 }
-            } else if ("javax.xml.transform.stax.StAXSource".equals(source.getClass().getName()))
{
-                try {
-                    return (XMLStreamReader)source.getClass()
-                        .getMethod("getXMLStreamReader").invoke(source);
-                } catch (Exception ex) {
-                    //ignore
-                }
+            } else if (source instanceof StAXSource) {
+                return ((StAXSource)source).getXMLStreamReader();
             } else if (source instanceof StaxSource) {
                 return ((StaxSource)source).getXMLStreamReader();
             } else if (source instanceof SAXSource) {



Mime
View raw message