taojintianxia commented on a change in pull request #11853:
URL: https://github.com/apache/shardingsphere/pull/11853#discussion_r690001868



##########
File path: 
shardingsphere-features/shardingsphere-readwrite-splitting/shardingsphere-readwrite-splitting-distsql/shardingsphere-readwrite-splitting-distsql-handler/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/query/ReadwriteSplittingRuleQueryResultSet.java
##########
@@ -64,9 +64,9 @@ public boolean next() {
     @Override
     public Collection<Object> getRowData() {
         ReadwriteSplittingDataSourceRuleConfiguration ruleConfig = data.next();
+        ShardingSphereAlgorithmConfiguration configuration = 
loadBalancers.get(ruleConfig.getLoadBalancerName());
         return Arrays.asList(ruleConfig.getName(), 
ruleConfig.getAutoAwareDataSourceName(), ruleConfig.getWriteDataSourceName(), 
Joiner.on(",").join(ruleConfig.getReadDataSourceNames()),
-                null == loadBalancers.get(ruleConfig.getLoadBalancerName()) ? 
null : loadBalancers.get(ruleConfig.getLoadBalancerName()).getType(),
-                
PropertiesConverter.convert(loadBalancers.get(ruleConfig.getLoadBalancerName()).getProps()));
+                null == configuration ? null : configuration.getType(), null 
== configuration ? null : 
PropertiesConverter.convert(configuration.getProps()));

Review comment:
       more than 1 conditional operator in a clause is not a good practice .




-- 
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