You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/03/14 10:33:01 UTC

[GitHub] [dubbo] chickenlj commented on a change in pull request #9775: Add instanceOf before class cast

chickenlj commented on a change in pull request #9775:
URL: https://github.com/apache/dubbo/pull/9775#discussion_r825800882



##########
File path: dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/command/util/ServiceCheckUtils.java
##########
@@ -47,6 +47,10 @@ public static int getConsumerAddressNum(ConsumerModel consumerModel) {
 
         Collection<Registry> registries = registryManager.getRegistries();
         if (CollectionUtils.isNotEmpty(registries)) {
+            Registry registry = registries.iterator().next();
+            if (!(registry instanceof AbstractRegistry)) {
+                return num;
+            }

Review comment:
       Please iterate registries and skip the instances that are not of AbstractRegistry type.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org