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

duanzhengqiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 54cfa5a82cd Fix sonar issue on ComputeNodeInstanceContext (#32788)
54cfa5a82cd is described below

commit 54cfa5a82cd06ee69d3f8a173a8233d6c7d203d0
Author: Liang Zhang <[email protected]>
AuthorDate: Tue Sep 3 17:48:21 2024 +0800

    Fix sonar issue on ComputeNodeInstanceContext (#32788)
---
 .../shardingsphere/infra/instance/ComputeNodeInstanceContext.java       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/infra/common/src/main/java/org/apache/shardingsphere/infra/instance/ComputeNodeInstanceContext.java
 
b/infra/common/src/main/java/org/apache/shardingsphere/infra/instance/ComputeNodeInstanceContext.java
index e569be71d87..8f72be5f0d9 100644
--- 
a/infra/common/src/main/java/org/apache/shardingsphere/infra/instance/ComputeNodeInstanceContext.java
+++ 
b/infra/common/src/main/java/org/apache/shardingsphere/infra/instance/ComputeNodeInstanceContext.java
@@ -193,7 +193,7 @@ public final class ComputeNodeInstanceContext {
     public Map<String, InstanceMetaData> getAllClusterInstances(final 
InstanceType instanceType, final Collection<String> labels) {
         Map<String, InstanceMetaData> result = new 
LinkedHashMap<>(allClusterInstances.size(), 1F);
         for (ComputeNodeInstance each : allClusterInstances) {
-            if (each.getMetaData().getType() == instanceType && 
labels.stream().anyMatch(((Collection<String>) each.getLabels())::contains)) {
+            if (each.getMetaData().getType() == instanceType && 
labels.stream().anyMatch(each.getLabels()::contains)) {
                 result.put(each.getMetaData().getId(), each.getMetaData());
             }
         }

Reply via email to