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

davsclaus pushed a commit to branch camel-4.4.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-4.4.x by this push:
     new 9249e0d957c CAMEL-20420: CSimple: use of builder throws 
UnsupportedOperationException (#13132)
9249e0d957c is described below

commit 9249e0d957c633ce34a885ad4413598afd5de20a
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Thu Feb 15 15:53:55 2024 +0100

    CAMEL-20420: CSimple: use of builder throws UnsupportedOperationException 
(#13132)
---
 .../main/java/org/apache/camel/language/csimple/CSimpleLanguage.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/core/camel-core-languages/src/main/java/org/apache/camel/language/csimple/CSimpleLanguage.java
 
b/core/camel-core-languages/src/main/java/org/apache/camel/language/csimple/CSimpleLanguage.java
index 3f87269a587..86b389e9c30 100644
--- 
a/core/camel-core-languages/src/main/java/org/apache/camel/language/csimple/CSimpleLanguage.java
+++ 
b/core/camel-core-languages/src/main/java/org/apache/camel/language/csimple/CSimpleLanguage.java
@@ -199,11 +199,11 @@ public class CSimpleLanguage extends TypedLanguageSupport 
implements StaticServi
         public CSimpleLanguage build() {
             final Map<String, CSimpleExpression> predicates = 
compiledPredicates.isEmpty()
                     ? Collections.emptyMap()
-                    : Collections.unmodifiableMap(compiledPredicates);
+                    : new ConcurrentHashMap<>(compiledPredicates);
             this.compiledPredicates = null; // invalidate the builder to 
prevent leaking the mutable collection
             final Map<String, CSimpleExpression> expressions = 
compiledExpressions.isEmpty()
                     ? Collections.emptyMap()
-                    : Collections.unmodifiableMap(compiledExpressions);
+                    : new ConcurrentHashMap<>(compiledExpressions);
             this.compiledExpressions = null; // invalidate the builder to 
prevent leaking the mutable collection
             return new CSimpleLanguage(predicates, expressions);
         }

Reply via email to