ableegoldman commented on code in PR #19616:
URL: https://github.com/apache/kafka/pull/19616#discussion_r2071077018


##########
clients/src/test/java/org/apache/kafka/clients/producer/internals/ProducerInterceptorsTest.java:
##########
@@ -126,7 +126,7 @@ public void onAcknowledgement(RecordMetadata metadata, 
Exception exception, Head
                 onErrorAckCount++;
                 // the length check is just to call topic() method and let it 
throw an exception
                 // if RecordMetadata.TopicPartition is null
-                if (metadata != null && metadata.topic().length() >= 0) {
+                if (metadata != null && !metadata.topic().isEmpty()) {

Review Comment:
   better yet just this:
   
   ```
    if (metadata != null) {
        if (metadata.topic() == null) {
           throw new WhateverException();
   
   ```



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