You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by li...@apache.org on 2020/04/20 04:56:56 UTC
[dubbo] branch master updated: fix potential
ConcurrentModificationException (#6031)
This is an automated email from the ASF dual-hosted git repository.
liujun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/master by this push:
new dbda449 fix potential ConcurrentModificationException (#6031)
dbda449 is described below
commit dbda44995c86b2a8b91f342885af3a07fe36828a
Author: ken.lj <ke...@gmail.com>
AuthorDate: Mon Apr 20 12:56:40 2020 +0800
fix potential ConcurrentModificationException (#6031)
fixes #6027
---
.../org/apache/dubbo/registry/support/AbstractRegistryFactory.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/AbstractRegistryFactory.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/AbstractRegistryFactory.java
index 413c68f..7ea5559 100644
--- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/AbstractRegistryFactory.java
+++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/AbstractRegistryFactory.java
@@ -28,6 +28,7 @@ import org.apache.dubbo.registry.RegistryService;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
+import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -61,7 +62,7 @@ public abstract class AbstractRegistryFactory implements RegistryFactory {
* @return all registries
*/
public static Collection<Registry> getRegistries() {
- return Collections.unmodifiableCollection(REGISTRIES.values());
+ return Collections.unmodifiableCollection(new LinkedList<>(REGISTRIES.values()));
}
public static Registry getRegistry(String key) {