camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1376525 - /camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfPayload.java
Date Thu, 23 Aug 2012 14:59:33 GMT
Author: dkulp
Date: Thu Aug 23 14:59:33 2012
New Revision: 1376525

URL: http://svn.apache.org/viewvc?rev=1376525&view=rev
Log:
Use CXF's staxutils to convert to the string avoiding a bunch of synch blocks and other issues.

Modified:
    camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfPayload.java

Modified: camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfPayload.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfPayload.java?rev=1376525&r1=1376524&r2=1376525&view=diff
==============================================================================
--- camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfPayload.java
(original)
+++ camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfPayload.java
Thu Aug 23 14:59:33 2012
@@ -24,13 +24,11 @@ import java.util.Map;
 import javax.xml.XMLConstants;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.transform.Source;
-import javax.xml.transform.TransformerException;
 import javax.xml.transform.dom.DOMSource;
 
 import org.w3c.dom.Element;
 
 import org.apache.camel.RuntimeCamelException;
-import org.apache.camel.converter.jaxp.XmlConverter;
 import org.apache.cxf.staxutils.StaxUtils;
 
 
@@ -140,7 +138,6 @@ public class CxfPayload<T> {
      *   large amounts of memory.
      */
     public String toString() {
-        XmlConverter converter = new XmlConverter();
         StringBuilder buf = new StringBuilder();
         buf.append(getClass().getName());
         buf.append(" headers: " + headers);
@@ -150,10 +147,10 @@ public class CxfPayload<T> {
         } else {
             buf.append("body: [ ");
             for (Element src : getBody()) {
-                String elementString = "";
+                String elementString;
                 try {
-                    elementString = converter.toString(src, null);
-                } catch (TransformerException e) {
+                    elementString = StaxUtils.toString(src);
+                } catch (XMLStreamException e) {
                     elementString = src.toString();
                 }
                 buf.append("[" + elementString + "]");



Mime
View raw message