servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1381465 - /servicemix/components/trunk/shared-libraries/servicemix-common/src/main/java/org/apache/servicemix/common/util/MessageUtil.java
Date Thu, 06 Sep 2012 02:38:07 GMT
Author: ffang
Date: Thu Sep  6 02:38:07 2012
New Revision: 1381465

URL: http://svn.apache.org/viewvc?rev=1381465&view=rev
Log:
[SMXCOMP-944]org.apache.servicemix.common.util.MessageUtil creates a new SourceTransformer
each time.

Modified:
    servicemix/components/trunk/shared-libraries/servicemix-common/src/main/java/org/apache/servicemix/common/util/MessageUtil.java

Modified: servicemix/components/trunk/shared-libraries/servicemix-common/src/main/java/org/apache/servicemix/common/util/MessageUtil.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/shared-libraries/servicemix-common/src/main/java/org/apache/servicemix/common/util/MessageUtil.java?rev=1381465&r1=1381464&r2=1381465&view=diff
==============================================================================
--- servicemix/components/trunk/shared-libraries/servicemix-common/src/main/java/org/apache/servicemix/common/util/MessageUtil.java
(original)
+++ servicemix/components/trunk/shared-libraries/servicemix-common/src/main/java/org/apache/servicemix/common/util/MessageUtil.java
Thu Sep  6 02:38:07 2012
@@ -46,6 +46,8 @@ import org.apache.servicemix.jbi.jaxp.So
 import org.apache.servicemix.jbi.jaxp.StringSource;
 
 public final class MessageUtil {
+    
+    private static SourceTransformer sourceTransformer = new SourceTransformer();
 
     private MessageUtil() {
     }
@@ -140,7 +142,7 @@ public final class MessageUtil {
         if (message.getContent() instanceof StreamSource
                 || message.getContent() instanceof SAXSource) {
             try {
-                String content = new SourceTransformer().contentToString(message);
+                String content = sourceTransformer.contentToString(message);
                 if (content != null) {
                     message.setContent(new StringSource(content));
                 }
@@ -170,7 +172,7 @@ public final class MessageUtil {
 
         public NormalizedMessageImpl(NormalizedMessage message) throws MessagingException
{
             try {
-                String str = new SourceTransformer().contentToString(message);
+                String str = sourceTransformer.contentToString(message);
                 if (str != null) {
                     this.content = new StringSource(str);
                 }



Mime
View raw message