kirktrue commented on code in PR #19964: URL: https://github.com/apache/kafka/pull/19964#discussion_r2153260298
########## clients/src/main/java/org/apache/kafka/common/TopicIdPartition.java: ########## @@ -78,6 +78,22 @@ public TopicPartition topicPartition() { return topicPartition; } + /** + * Checking if TopicIdPartition meant to be the same reference to same this object but doesn't have all the data. + * If topic name is empty and topic id is persisted then the method will relay on topic id only + * otherwise the method will relay on topic name. Review Comment: Nit: I believe this is meant to be _rely_: ```suggestion * If topic name is empty and topic id is persisted then the method will rely on topic id only * otherwise the method will rely on topic name. ``` ########## clients/src/main/java/org/apache/kafka/common/TopicIdPartition.java: ########## @@ -78,6 +78,22 @@ public TopicPartition topicPartition() { return topicPartition; } + /** + * Checking if TopicIdPartition meant to be the same reference to same this object but doesn't have all the data. + * If topic name is empty and topic id is persisted then the method will relay on topic id only + * otherwise the method will relay on topic name. + * @return true if topic has same topicId and partition index as topic names some time might be empty. + */ + public boolean same(TopicIdPartition tpId) { + boolean emptyTopicName = tpId.topic() == null || tpId.topic().isEmpty(); Review Comment: Minor suggestion—`Utils.isBlank()` is a little more succinct and catches cases where the string is whitespace only. ```suggestion boolean emptyTopicName = Utils.isBlank(tpId.topic()); ``` -- 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