From c0394f5dd97bf330bc02bb9ef355046fcff8f9f3 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Sun, 24 Sep 2023 22:10:11 +0800 Subject: [PATCH] Refactor RuleMetaData --- .../infra/metadata/database/rule/RuleMetaData.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/rule/RuleMetaData.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/rule/RuleMetaData.java index b6f19114627f7..2faff7afb2d3a 100644 --- a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/rule/RuleMetaData.java +++ b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/rule/RuleMetaData.java @@ -24,7 +24,6 @@ import java.util.Collection; import java.util.LinkedList; -import java.util.List; import java.util.Optional; import java.util.concurrent.CopyOnWriteArrayList; import java.util.stream.Collectors; @@ -58,7 +57,7 @@ public Collection getConfigurations() { * @return found rules */ public Collection findRules(final Class clazz) { - List result = new LinkedList<>(); + Collection result = new LinkedList<>(); for (ShardingSphereRule each : rules) { if (clazz.isAssignableFrom(each.getClass())) { result.add(clazz.cast(each));