camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1376534 - /camel/branches/camel-2.10.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfPayload.java
Date Thu, 23 Aug 2012 15:10:27 GMT
Author: dkulp
Date: Thu Aug 23 15:10:26 2012
New Revision: 1376534

URL: http://svn.apache.org/viewvc?rev=1376534&view=rev
Log:
Merged revisions 1376525 via  git cherry-pick from
https://svn.apache.org/repos/asf/camel/trunk

........
  r1376525 | dkulp | 2012-08-23 10:59:33 -0400 (Thu, 23 Aug 2012) | 2 lines

  Use CXF's staxutils to convert to the string avoiding a bunch of synch blocks and other
issues.

........

Modified:
    camel/branches/camel-2.10.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfPayload.java

Modified: camel/branches/camel-2.10.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfPayload.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfPayload.java?rev=1376534&r1=1376533&r2=1376534&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfPayload.java
(original)
+++ camel/branches/camel-2.10.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfPayload.java
Thu Aug 23 15:10:26 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