divijvaidya commented on code in PR #13966: URL: https://github.com/apache/kafka/pull/13966#discussion_r1266621190
########## clients/src/main/java/org/apache/kafka/common/network/DefaultChannelMetadataRegistry.java: ########## @@ -16,15 +16,15 @@ */ package org.apache.kafka.common.network; +import java.util.Objects; + public class DefaultChannelMetadataRegistry implements ChannelMetadataRegistry { private CipherInformation cipherInformation; private ClientInformation clientInformation; @Override public void registerCipherInformation(final CipherInformation cipherInformation) { - if (this.cipherInformation != null) { - this.cipherInformation = cipherInformation; - } + this.cipherInformation = Objects.requireNonNull(cipherInformation); Review Comment: > Will we want to keep the added unit test in this case, any thoughts? No. unit test for a test will not be required in that case. Let's move that file to tests. Although it's a public class but it cannot be used outside of Kafka code base. -- 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