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 2021/10/27 12:11:01 UTC

[dubbo] branch master updated: change getRegistries return type to HashSet for unique (#9016)

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 beb97e4  change getRegistries return type to HashSet for unique (#9016)
beb97e4 is described below

commit beb97e4f92426afccdbbc774db36f0dbe7f9011b
Author: zrlw <zr...@sina.com>
AuthorDate: Wed Oct 27 20:10:44 2021 +0800

    change getRegistries return type to HashSet for unique (#9016)
---
 .../org/apache/dubbo/registry/support/AbstractRegistryFactory.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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 7acab0f..3a6af64 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
@@ -30,7 +30,7 @@ import org.apache.dubbo.registry.client.ServiceDiscoveryRegistry;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
-import java.util.LinkedList;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.atomic.AtomicBoolean;
@@ -65,7 +65,7 @@ public abstract class AbstractRegistryFactory implements RegistryFactory {
      * @return all registries
      */
     public static Collection<Registry> getRegistries() {
-        return Collections.unmodifiableCollection(new LinkedList<>(REGISTRIES.values()));
+        return Collections.unmodifiableCollection(new HashSet<>(REGISTRIES.values()));
     }
 
     public static Registry getRegistry(String key) {