tristaZero edited a comment on issue #2666: Fixes #2629
URL: 
https://github.com/apache/incubator-shardingsphere/pull/2666#issuecomment-509077891
 
 
   Hi, Considering user will create ShardingRule to create ShardingDataSource, 
i think it is better to judge whether null == shardingRuleConfig, but do you 
think it is better to add this judgement in ShardingRule.java?
   ```
   public ShardingRule(final ShardingRuleConfiguration shardingRuleConfig, 
final Collection<String> dataSourceNames) {
           // Here just checking dataSourceNames, maybe we can add checking 
shardingRuleConfig?
           Preconditions.checkArgument(!.isEmpty(), "Data sources cannot be 
empty.");
           this.shardingRuleConfig = shardingRuleConfig;
          // If we add shardingRuleConfig checking ahead, there is no chance to 
enter into it, if shardingRuleConfig is null.
           shardingDataSourceNames = new 
ShardingDataSourceNames(shardingRuleConfig, dataSourceNames);
   ```
   Once ShardingRule, i.e, ShardingDataSource is created, it is impossible that 
shardingRule will be null in RoutingEngineFactory. What do you think? 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to