You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2012/09/25 21:12:04 UTC
svn commit: r1390056 -
/cxf/trunk/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
Author: dkulp
Date: Tue Sep 25 19:12:04 2012
New Revision: 1390056
URL: http://svn.apache.org/viewvc?rev=1390056&view=rev
Log:
[CXF-4521] Detect if other Stax Impls are threadsafe
Patch from Ivan/xuhaihong applied
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=1390056&r1=1390055&r2=1390056&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 Tue Sep 25 19:12:04 2012
@@ -140,16 +140,23 @@ public final class StaxUtils {
innerElementCountThreshold = -1;
}
XMLInputFactory xif = createXMLInputFactory(true);
- if (!xif.getClass().getName().contains("ctc.wstx")) {
- xif = null;
+ String xifClassName = xif.getClass().getName();
+ if (xifClassName.contains("ctc.wstx") || xifClassName.contains("xml.xlxp")
+ || xifClassName.contains("xml.xlxp2") || xifClassName.contains("bea.core")) {
+ SAFE_INPUT_FACTORY = xif;
+ } else {
+ SAFE_INPUT_FACTORY = null;
}
- SAFE_INPUT_FACTORY = xif;
XMLOutputFactory xof = XMLOutputFactory.newInstance();
- if (!xof.getClass().getName().contains("ctc.wstx")) {
- xof = null;
+ String xofClassName = xof.getClass().getName();
+ if (xofClassName.contains("ctc.wstx") || xofClassName.contains("xml.xlxp")
+ || xofClassName.contains("xml.xlxp2") || xofClassName.contains("bea.core")) {
+ SAFE_OUTPUT_FACTORY = xof;
+ } else {
+ SAFE_OUTPUT_FACTORY = null;
}
- SAFE_OUTPUT_FACTORY = xof;
+
}
private StaxUtils() {