You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/05/14 12:54:43 UTC

[GitHub] [shardingsphere] terrymanu commented on a change in pull request #5605: Fix orchestration create datasource error when datasource map is empty

terrymanu commented on a change in pull request #5605:
URL: https://github.com/apache/shardingsphere/pull/5605#discussion_r425112482



##########
File path: sharding-jdbc/sharding-jdbc-orchestration/src/main/java/org/apache/shardingsphere/shardingjdbc/orchestration/api/yaml/YamlOrchestrationShardingSphereDataSourceFactory.java
##########
@@ -100,7 +100,7 @@ public static DataSource createDataSource(final Map<String, DataSource> dataSour
     
     private static DataSource createDataSource(final Map<String, DataSource> dataSourceMap, final YamlOrchestrationRootRuleConfigurations configurations, 
                                                final Properties props, final Map<String, YamlCenterRepositoryConfiguration> yamlInstanceConfigurationMap) throws SQLException {
-        if (null == configurations) {
+        if (configurations.getRules().size() == 0 || dataSourceMap.size() == 0) {

Review comment:
       please use `isEmpty()`




----------------------------------------------------------------
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:
users@infra.apache.org