diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/resource/ResourceMetaData.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/resource/ResourceMetaData.java index 9be01787019b99..49ef85f8f46e94 100644 --- a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/resource/ResourceMetaData.java +++ b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/resource/ResourceMetaData.java @@ -25,7 +25,6 @@ import org.apache.shardingsphere.infra.metadata.database.resource.node.StorageNode; import org.apache.shardingsphere.infra.metadata.database.resource.node.StorageNodeName; import org.apache.shardingsphere.infra.metadata.database.resource.node.StorageNodeUtils; -import org.apache.shardingsphere.infra.metadata.database.resource.unit.NewStorageUnitMetaData; import org.apache.shardingsphere.infra.metadata.database.resource.unit.StorageUnitMetaData; import org.apache.shardingsphere.infra.metadata.database.resource.unit.StorageUnitNodeMapUtils; @@ -68,9 +67,9 @@ public ResourceMetaData(final String databaseName, final Map getAllInstanceDataSourceNames() { Collection result = new LinkedList<>(); - for (Entry entry : storageUnitMetaData.getMetaDataMap().entrySet()) { - if (!isExisted(entry.getKey(), result)) { - result.add(entry.getKey()); + for (String each : storageUnitMetaData.getMetaDataMap().keySet()) { + if (!isExisted(each, result)) { + result.add(each); } } return result;