You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "RaigorJiang (via GitHub)" <gi...@apache.org> on 2023/04/10 02:55:56 UTC

[GitHub] [shardingsphere] RaigorJiang commented on a diff in pull request #25036: Improve properties verification of TrafficAlgorithm #24754

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


##########
kernel/traffic/core/src/main/java/org/apache/shardingsphere/traffic/algorithm/traffic/segment/SQLMatchTrafficAlgorithm.java:
##########
@@ -41,8 +44,11 @@ public final class SQLMatchTrafficAlgorithm implements SegmentTrafficAlgorithm {
     
     @Override
     public void init(final Properties props) {
-        Preconditions.checkArgument(props.containsKey(SQL_PROPS_KEY), "%s cannot be null.", SQL_PROPS_KEY);
+        ShardingSpherePreconditions.checkState(props.containsKey(SQL_PROPS_KEY),
+                () -> new SegmentTrafficAlgorithmInitializationException(SQLMatchTrafficAlgorithm.class.getName(), String.format("%s cannot be null", SQL_PROPS_KEY)));
         sql = getExactlySQL(props.getProperty(SQL_PROPS_KEY));
+        ShardingSpherePreconditions.checkState(Strings.isNullOrEmpty(String.valueOf(sql)),

Review Comment:
   Is the expectation here is sql null or empty?



-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org