Author: klape
Date: 2013-08-06 16:59:13 -0400 (Tue, 06 Aug 2013)
New Revision: 17855
Modified:
thirdparty/cxf/branches/cxf-2.2.12/rt/core/src/main/java/org/apache/cxf/databinding/source/SourceDataBinding.java
Log:
[JBPAPP-10819] SourceDataBinding doesn't create a thread safe DataReader
Modified:
thirdparty/cxf/branches/cxf-2.2.12/rt/core/src/main/java/org/apache/cxf/databinding/source/SourceDataBinding.java
===================================================================
---
thirdparty/cxf/branches/cxf-2.2.12/rt/core/src/main/java/org/apache/cxf/databinding/source/SourceDataBinding.java 2013-08-03
02:37:23 UTC (rev 17854)
+++
thirdparty/cxf/branches/cxf-2.2.12/rt/core/src/main/java/org/apache/cxf/databinding/source/SourceDataBinding.java 2013-08-06
20:59:13 UTC (rev 17855)
@@ -35,18 +35,8 @@
public static final String PREFERRED_FORMAT = "source-preferred-format";
- private XMLStreamDataReader xsrReader;
- private XMLStreamDataWriter xswWriter;
- private NodeDataWriter nodeWriter;
- private NodeDataReader nodeReader;
-
public SourceDataBinding() {
super();
- this.xsrReader = new XMLStreamDataReader();
- this.xswWriter = new XMLStreamDataWriter();
-
- this.nodeReader = new NodeDataReader();
- this.nodeWriter = new NodeDataWriter();
}
public void initialize(Service service) {
@@ -57,9 +47,9 @@
@SuppressWarnings("unchecked")
public <T> DataReader<T> createReader(Class<T> cls) {
if (cls == XMLStreamReader.class) {
- return (DataReader<T>) xsrReader;
+ return (DataReader<T>) new XMLStreamDataReader();
} else if (cls == Node.class) {
- return (DataReader<T>) nodeReader;
+ return (DataReader<T>) new NodeDataReader();
} else {
throw new UnsupportedOperationException("The type " + cls.getName()
+ " is not supported.");
}
@@ -72,9 +62,9 @@
@SuppressWarnings("unchecked")
public <T> DataWriter<T> createWriter(Class<T> cls) {
if (cls == XMLStreamWriter.class) {
- return (DataWriter<T>) xswWriter;
+ return (DataWriter<T>) new XMLStreamDataWriter();
} else if (cls == Node.class) {
- return (DataWriter<T>) nodeWriter;
+ return (DataWriter<T>) new NodeDataWriter();
} else {
throw new UnsupportedOperationException("The type " + cls.getName()
+ " is not supported.");
}
Show replies by date