From 54cfa5a82cd06ee69d3f8a173a8233d6c7d203d0 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Tue, 3 Sep 2024 17:48:21 +0800 Subject: [PATCH] Fix sonar issue on ComputeNodeInstanceContext (#32788) --- .../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 e569be71d8703..8f72be5f0d9b4 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 void deleteComputeNodeInstance(final ComputeNodeInstance instance) { public Map getAllClusterInstances(final InstanceType instanceType, final Collection labels) { Map result = new LinkedHashMap<>(allClusterInstances.size(), 1F); for (ComputeNodeInstance each : allClusterInstances) { - if (each.getMetaData().getType() == instanceType && labels.stream().anyMatch(((Collection) each.getLabels())::contains)) { + if (each.getMetaData().getType() == instanceType && labels.stream().anyMatch(each.getLabels()::contains)) { result.put(each.getMetaData().getId(), each.getMetaData()); } }