camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r801289 - in /camel/trunk/camel-core/src: main/java/org/apache/camel/util/ExchangeHelper.java test/java/org/apache/camel/processor/SimpleMockTest.java
Date Wed, 05 Aug 2009 16:37:08 GMT
Author: davsclaus
Date: Wed Aug  5 16:37:08 2009
New Revision: 801289

URL: http://svn.apache.org/viewvc?rev=801289&view=rev
Log:
A little optimizations to only copy when needed.

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/util/ExchangeHelper.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/processor/SimpleMockTest.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/util/ExchangeHelper.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ExchangeHelper.java?rev=801289&r1=801288&r2=801289&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/util/ExchangeHelper.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/util/ExchangeHelper.java Wed Aug
 5 16:37:08 2009
@@ -234,8 +234,10 @@
                     result.getIn().copyFrom(source.getIn());
                 }
             }
-            result.getProperties().clear();
-            result.getProperties().putAll(source.getProperties());
+
+            if (source.hasProperties()) {
+                result.getProperties().putAll(source.getProperties());
+            }
         }
     }
 
@@ -271,8 +273,9 @@
         result.setException(source.getException());
         
         // copy properties
-        result.getProperties().clear();
-        result.getProperties().putAll(source.getProperties());
+        if (source.hasProperties()) {
+            result.getProperties().putAll(source.getProperties());
+        }
     }
 
     /**

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/SimpleMockTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/SimpleMockTest.java?rev=801289&r1=801288&r2=801289&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/SimpleMockTest.java (original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/SimpleMockTest.java Wed
Aug  5 16:37:08 2009
@@ -39,7 +39,7 @@
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("direct:start").to("log:foo").to("mock:result");
+                from("direct:start").to("log:foo").to("log:bar").to("mock:result");
             }
         };
     }



Mime
View raw message