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 0cb3627a14714..5d56abca1a06f 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 @@ -134,17 +134,17 @@ private Collection getInUsedStorageUnitNames(final DataNodeContainedRule return rule.getAllDataNodes().values().stream().flatMap(each -> each.stream().map(DataNode::getDataSourceName).collect(Collectors.toSet()).stream()).collect(Collectors.toSet()); } - private void mergeInUsedStorageUnitNameAndRules(final Map>> storageUnitNameAndRulesMap, - final Map>> toBeMergeStorageUnitNameAndRulesMap) { - for (Entry>> entry : toBeMergeStorageUnitNameAndRulesMap.entrySet()) { - if (storageUnitNameAndRulesMap.containsKey(entry.getKey())) { + private void mergeInUsedStorageUnitNameAndRules(final Map>> storageUnitNameAndRules, + final Map>> toBeMergedStorageUnitNameAndRules) { + for (Entry>> entry : toBeMergedStorageUnitNameAndRules.entrySet()) { + if (storageUnitNameAndRules.containsKey(entry.getKey())) { for (Class each : entry.getValue()) { - if (!storageUnitNameAndRulesMap.get(entry.getKey()).contains(each)) { - storageUnitNameAndRulesMap.get(entry.getKey()).add(each); + if (!storageUnitNameAndRules.get(entry.getKey()).contains(each)) { + storageUnitNameAndRules.get(entry.getKey()).add(each); } } } else { - storageUnitNameAndRulesMap.put(entry.getKey(), entry.getValue()); + storageUnitNameAndRules.put(entry.getKey(), entry.getValue()); } } }