philipnee commented on code in PR #14638:
URL: https://github.com/apache/kafka/pull/14638#discussion_r1372117884


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/SubscriptionState.java:
##########
@@ -285,10 +285,8 @@ public synchronized void 
assignFromSubscribed(Collection<TopicPartition> assignm
         this.assignment.set(assignedPartitionStates);
     }
 
-    private void registerRebalanceListener(ConsumerRebalanceListener listener) 
{
-        if (listener == null)
-            throw new IllegalArgumentException("RebalanceListener cannot be 
null");
-        this.rebalanceListener = listener;
+    private void registerRebalanceListener(Optional<ConsumerRebalanceListener> 
listener) {
+        this.rebalanceListener = Objects.requireNonNull(listener, 
"RebalanceListener cannot be null");

Review Comment:
   Does Objects.requireNonNull checks the lister.get() or the listener? Since 
you are passing in an Optional.



-- 
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-unsubscr...@kafka.apache.org

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

Reply via email to