Author: dkulp Date: Mon Jan 11 17:39:14 2010 New Revision: 897962 URL: http://svn.apache.org/viewvc?rev=897962&view=rev Log: Merged revisions 897957 via svnmerge from https://svn.apache.org/repos/asf/cxf/branches/2.2.x-fixes
................ r897957 | dkulp | 2010-01-11 12:23:50 -0500 (Mon, 11 Jan 2010) | 9 lines Merged revisions 897944 via svnmerge from https://svn.apache.org/repos/asf/cxf/trunk ........ r897944 | dkulp | 2010-01-11 12:00:25 -0500 (Mon, 11 Jan 2010) | 1 line Some versions of Sun's jaxp throw and exception, they don't return null. ........ ................ Modified: cxf/branches/2.1.x-fixes/ (props changed) cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java Propchange: cxf/branches/2.1.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java?rev=897962&r1=897961&r2=897962&view=diff ============================================================================== --- cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java (original) +++ cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java Mon Jan 11 17:39:14 2010 @@ -976,7 +976,25 @@ XMLInputFactory factory = getXMLInputFactory(); try { - return factory.createXMLStreamReader(source); + XMLStreamReader reader = null; + + try { + reader = factory.createXMLStreamReader(source); + } catch (UnsupportedOperationException e) { + //ignore + } + if (reader == null && source instanceof StreamSource) { + //createXMLStreamReader from Source is optional, we'll try and map it + StreamSource ss = (StreamSource)source; + if (ss.getInputStream() != null) { + reader = factory.createXMLStreamReader(ss.getSystemId(), + ss.getInputStream()); + } else { + reader = factory.createXMLStreamReader(ss.getSystemId(), + ss.getReader()); + } + } + return reader; } finally { returnXMLInputFactory(factory); }
