Author: dkulp Date: Wed Oct 19 18:58:11 2011 New Revision: 1186403 URL: http://svn.apache.org/viewvc?rev=1186403&view=rev Log: Merged revisions 1186387 via svnmerge from https://svn.us.apache.org/repos/asf/cxf/branches/2.4.x-fixes
................ r1186387 | dkulp | 2011-10-19 14:31:34 -0400 (Wed, 19 Oct 2011) | 9 lines Merged revisions 1183575 via svnmerge from https://svn.apache.org/repos/asf/cxf/trunk ........ r1183575 | dkulp | 2011-10-14 20:41:57 -0400 (Fri, 14 Oct 2011) | 1 line Minor performance improvement ........ ................ Modified: cxf/branches/2.3.x-fixes/ (props changed) cxf/branches/2.3.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java Propchange: cxf/branches/2.3.x-fixes/ ('svn:mergeinfo' removed) Propchange: cxf/branches/2.3.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.3.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java?rev=1186403&r1=1186402&r2=1186403&view=diff ============================================================================== --- cxf/branches/2.3.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java (original) +++ cxf/branches/2.3.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java Wed Oct 19 18:58:11 2011 @@ -399,7 +399,20 @@ public final class StaxUtils { } } public static void copy(Source source, XMLStreamWriter writer) throws XMLStreamException { - if (source instanceof SAXSource) { + if (source instanceof StaxSource) { + StaxSource ss = (StaxSource)source; + 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 SAXSource) { SAXSource ss = (SAXSource)source; InputSource src = ss.getInputSource(); if (src == null || (src.getSystemId() == null && src.getPublicId() == null)) { @@ -425,9 +438,7 @@ public final class StaxUtils { } } - } - - if (source instanceof StreamSource) { + } else if (source instanceof StreamSource) { StreamSource ss = (StreamSource)source; if (ss.getInputStream() == null && ss.getReader() == null
