[camel] branch master updated: Revert "camel-core optimize - No need to use copy on array list here"

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[camel] branch master updated: Revert "camel-core optimize - No need to use copy on array list here"

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 55c1c84  Revert "camel-core optimize - No need to use copy on array list here"
55c1c84 is described below

commit 55c1c842932c842d87068b3825558c055251d2c8
Author: Claus Ibsen <[hidden email]>
AuthorDate: Wed Feb 12 05:30:51 2020 +0100

    Revert "camel-core optimize - No need to use copy on array list here"
   
    This reverts commit f6f7119f4e959af4b83c7c0cd8f549316bd7d18f.
---
 .../src/main/java/org/apache/camel/support/ChildServiceSupport.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/core/camel-support/src/main/java/org/apache/camel/support/ChildServiceSupport.java b/core/camel-support/src/main/java/org/apache/camel/support/ChildServiceSupport.java
index c3bbb30..bf1a820 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/ChildServiceSupport.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/ChildServiceSupport.java
@@ -16,8 +16,8 @@
  */
 package org.apache.camel.support;
 
-import java.util.ArrayList;
 import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
 
 import org.apache.camel.RuntimeCamelException;
 import org.apache.camel.Service;
@@ -127,7 +127,7 @@ public abstract class ChildServiceSupport extends ServiceSupport {
             if (childServices == null) {
                 synchronized (lock) {
                     if (childServices == null) {
-                        childServices = new ArrayList<>();
+                        childServices = new CopyOnWriteArrayList<>();
                     }
                 }
             }