From 1fe4130f93e52615f1fa8e8ff9a0ae4fedc38dfc Mon Sep 17 00:00:00 2001 From: zhangliang Date: Sun, 19 Jan 2025 11:25:51 +0800 Subject: [PATCH] Refactor ShardingSphereDatabasesFactory's return value as collection --- .../metadata/database/ShardingSphereDatabasesFactory.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/ShardingSphereDatabasesFactory.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/ShardingSphereDatabasesFactory.java index 8c8814d955bb1..c650951b467e2 100644 --- a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/ShardingSphereDatabasesFactory.java +++ b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/ShardingSphereDatabasesFactory.java @@ -30,6 +30,7 @@ import java.sql.SQLException; import java.util.Collection; import java.util.HashSet; +import java.util.LinkedList; import java.util.Map; import java.util.Map.Entry; import java.util.stream.Collectors; @@ -78,7 +79,7 @@ public static Collection create(final Map result = new HashSet<>(databaseConfigMap.size() + systemDatabase.getSystemDatabaseSchemaMap().size(), 1F); + Collection result = new LinkedList<>(); result.addAll(createGenericDatabases(databaseConfigMap, protocolType, systemDatabase, props, instanceContext)); result.addAll(createSystemDatabases(databaseConfigMap, protocolType, systemDatabase, props)); return result;