diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/ProviderConsumerRegTable.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/ProviderConsumerRegTable.java index 620c534fb8e..9af39888e21 100644 --- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/ProviderConsumerRegTable.java +++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/ProviderConsumerRegTable.java @@ -72,9 +72,9 @@ public static ProviderInvokerWrapper getProviderWrapper(URL registeredPro return null; } - for (Invoker inv : invokers.keySet()) { - if (inv == invoker) { - return invokers.get(inv); + for (Map.Entry entry : invokers.entrySet()) { + if (entry.getKey() == invoker) { + return entry.getValue(); } }