flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [flink] luoyuxia commented on a change in pull request #16417: FLINK-22969
Date Thu, 08 Jul 2021 09:13:29 GMT

luoyuxia commented on a change in pull request #16417:
URL: https://github.com/apache/flink/pull/16417#discussion_r666013983



##########
File path: flink-connectors/flink-connector-kafka/src/main/java/org/apache/flink/streaming/connectors/kafka/FlinkKafkaProducer.java
##########
@@ -647,8 +646,10 @@ private FlinkKafkaProducer(
                 new FlinkKafkaProducer.TransactionStateSerializer(),
                 new FlinkKafkaProducer.ContextStateSerializer());
 
+        checkArgument(
+                !org.apache.flink.util.StringUtils.isNullOrWhitespaceOnly(defaultTopic),
+                "defaultTopic cannot be null or empty string");
         this.defaultTopicId = checkNotNull(defaultTopic, "defaultTopic is null");

Review comment:
       As we have checked the defaultTopicId is null or not before by the statement checkArgument(xxx),
here we don't need to checknotNull again.
   we can just assign this.defaultTopicId without any check.
   
   this.defaultTopicId = defaultTopic




-- 
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: issues-unsubscribe@flink.apache.org

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



Mime
View raw message