This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new aa4b8cfe824 (chores) camel-core: cleanup parameter with constant value
aa4b8cfe824 is described below

commit aa4b8cfe8240c9140e5a18271c4111ec4a732534
Author: Otavio Rodolfo Piske <[email protected]>
AuthorDate: Wed Sep 27 14:32:30 2023 +0200

    (chores) camel-core: cleanup parameter with constant value
    
    Remove preserveExchangeId from copyAndPrepareSubExchange as it is always 
true
---
 .../src/main/java/org/apache/camel/processor/Splitter.java     | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git 
a/core/camel-core-processor/src/main/java/org/apache/camel/processor/Splitter.java
 
b/core/camel-core-processor/src/main/java/org/apache/camel/processor/Splitter.java
index 0224397e03b..7fb12e4471c 100644
--- 
a/core/camel-core-processor/src/main/java/org/apache/camel/processor/Splitter.java
+++ 
b/core/camel-core-processor/src/main/java/org/apache/camel/processor/Splitter.java
@@ -193,7 +193,7 @@ public class Splitter extends MulticastProcessor implements 
AsyncProcessor, Trac
                 this.iterator = ObjectHelper.createIterator(value, delimiter);
             }
 
-            this.copy = copyAndPrepareSubExchange(exchange, true);
+            this.copy = copyAndPrepareSubExchange(exchange);
             this.route = ExchangeHelper.getRoute(exchange);
         }
 
@@ -328,12 +328,10 @@ public class Splitter extends MulticastProcessor 
implements AsyncProcessor, Trac
         return expression;
     }
 
-    private Exchange copyAndPrepareSubExchange(Exchange exchange, boolean 
preserveExchangeId) {
+    private Exchange copyAndPrepareSubExchange(Exchange exchange) {
         Exchange answer = processorExchangeFactory.createCopy(exchange);
-        if (preserveExchangeId) {
-            // must preserve exchange id
-            answer.setExchangeId(exchange.getExchangeId());
-        }
+        // must preserve exchange id
+        answer.setExchangeId(exchange.getExchangeId());
         if (exchange.getContext().isMessageHistory()) {
             // we do not want to copy the message history for split 
sub-messages
             answer.removeProperty(ExchangePropertyKey.MESSAGE_HISTORY);

Reply via email to