You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2017/05/25 14:46:38 UTC
camel git commit: CAMEL-11149: SPI - Allow to plugin different
headers map implementation.
Repository: camel
Updated Branches:
refs/heads/master 2dc3a599c -> d9004016d
CAMEL-11149: SPI - Allow to plugin different headers map implementation.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/d9004016
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/d9004016
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/d9004016
Branch: refs/heads/master
Commit: d9004016d2130034e4b842dff248a6a4b1b0716f
Parents: 2dc3a59
Author: Claus Ibsen <da...@apache.org>
Authored: Thu May 25 16:45:46 2017 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu May 25 16:45:46 2017 +0200
----------------------------------------------------------------------
.../java/org/apache/camel/impl/DefaultExchange.java | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/d9004016/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java b/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java
index 229b274..6db0770 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java
@@ -17,6 +17,7 @@
package org.apache.camel.impl;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -141,7 +142,7 @@ public final class DefaultExchange implements Exchange {
return null;
}
- Map<String, Object> answer = createProperties();
+ Map<String, Object> answer = createProperties(properties);
// safe copy message history using a defensive copy
List<MessageHistory> history = (List<MessageHistory>) answer.remove(Exchange.MESSAGE_HISTORY);
@@ -519,8 +520,13 @@ public final class DefaultExchange implements Exchange {
}
protected Map<String, Object> createProperties() {
- // TODO: a concurrent map is likely not needed
- return new ConcurrentHashMap<String, Object>();
+ // TODO: likely not needed, we can use a HashMap
+ return new ConcurrentHashMap<>();
+ }
+
+ protected Map<String, Object> createProperties(Map<String, Object> properties) {
+ // TODO: likely not needed, we can use a HashMap
+ return new ConcurrentHashMap<>(properties);
}
private static boolean isExcludePatternMatch(String key, String... excludePatterns) {