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

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


The following commit(s) were added to refs/heads/main by this push:
     new 19696254d [AMQ-9376] Fix ConcurrentModificationException during a 
destroy()
     new ca35e5921 Merge pull request #1108 from hyteio/AMQ-9376
19696254d is described below

commit 19696254dddf169fa62d502a53fa0351bad3d080
Author: Matt Pavlovich <m...@hyte.io>
AuthorDate: Tue Nov 7 08:12:46 2023 -0600

    [AMQ-9376] Fix ConcurrentModificationException during a destroy()
---
 .../main/java/org/apache/activemq/osgi/ActiveMQServiceFactory.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/activemq-osgi/src/main/java/org/apache/activemq/osgi/ActiveMQServiceFactory.java
 
b/activemq-osgi/src/main/java/org/apache/activemq/osgi/ActiveMQServiceFactory.java
index e507dd456..254007e08 100644
--- 
a/activemq-osgi/src/main/java/org/apache/activemq/osgi/ActiveMQServiceFactory.java
+++ 
b/activemq-osgi/src/main/java/org/apache/activemq/osgi/ActiveMQServiceFactory.java
@@ -22,6 +22,7 @@ import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Properties;
+import java.util.Set;
 
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.spring.SpringBrokerContext;
@@ -182,7 +183,8 @@ public class ActiveMQServiceFactory implements 
ManagedServiceFactory {
        }
 
     synchronized public void destroy() {
-        for (String broker : brokers.keySet()) {
+        Set<String> tmpBrokersSet = brokers.keySet();
+        for (String broker : tmpBrokersSet) {
             deleted(broker);
         }
     }

Reply via email to