You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/06/21 22:27:53 UTC

[GitHub] [kafka] C0urante commented on a diff in pull request #12321: KAFKA-14012: Adding null checks for cases when closeQuietly was being passed a lambda object

C0urante commented on code in PR #12321:
URL: https://github.com/apache/kafka/pull/12321#discussion_r903115034


##########
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/AbstractWorkerSourceTask.java:
##########
@@ -241,6 +242,7 @@ protected AbstractWorkerSourceTask(ConnectorTaskId id,
         this.sourceTaskMetricsGroup = new SourceTaskMetricsGroup(id, connectMetrics);
         this.topicTrackingEnabled = workerConfig.getBoolean(TOPIC_TRACKING_ENABLE_CONFIG);
         this.topicCreation = TopicCreation.newTopicCreation(workerConfig, topicGroups);
+        Objects.requireNonNull(this.offsetStore);

Review Comment:
   Two nits:
   1. We should probably add a message just in case something changes later and this ends up breaking in prod; something like "offset store cannot be null for source tasks" should be fine
   2. We don't even have to give this its own line; we can just tweak the line above from `this.offsetStore = offsetStore;` to `this.offsetStore = Objects.requireNonNull(offsetStore, "some message");`



-- 
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: jira-unsubscribe@kafka.apache.org

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