RaigorJiang commented on code in PR #20777:
URL: https://github.com/apache/shardingsphere/pull/20777#discussion_r964413609


##########
shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/checker/ShardingTableRuleStatementChecker.java:
##########
@@ -278,24 +278,34 @@ private static void checkTableRule(final String 
databaseName, final ShardingRule
     }
     
     private static void checkStrategy(final String databaseName, final 
ShardingRuleConfiguration currentRuleConfig, final Collection<TableRuleSegment> 
rules) throws DistSQLException {
-        Collection<String> currentAlgorithms = null == currentRuleConfig ? 
Collections.emptySet() : currentRuleConfig.getShardingAlgorithms().keySet();
+        Map<String, AlgorithmConfiguration> currentAlgorithms = null == 
currentRuleConfig ? new HashMap<>() : currentRuleConfig.getShardingAlgorithms();

Review Comment:
   Can `new HashMap<>` be replaced with `Collections.emptyMap()`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to