Author: ningjiang
Date: Fri Aug 28 13:05:51 2009
New Revision: 808877
URL: http://svn.apache.org/viewvc?rev=808877&view=rev
Log:
CAMEL-1955 better performance as Claus suggested
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/MessageSupport.java
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/MessageSupport.java
URL:
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/MessageSupport.java?rev=808877&r1=808876&r2=808877&view=diff
==============================================================================
---
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/MessageSupport.java
(original)
+++
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/MessageSupport.java
Fri Aug 28 13:05:51 2009
@@ -131,11 +131,16 @@
public void copyFrom(Message that) {
setMessageId(that.getMessageId());
setBody(that.getBody());
- getHeaders().clear();
+ if (hasHeaders()) {
+ getHeaders().clear();
+ }
if (that.hasHeaders()) {
getHeaders().putAll(that.getHeaders());
}
- getAttachments().clear();
+
+ if (hasAttachments()) {
+ getAttachments().clear();
+ }
if (that.hasAttachments()) {
getAttachments().putAll(that.getAttachments());
}