dajac commented on code in PR #13966: URL: https://github.com/apache/kafka/pull/13966#discussion_r1254320546
########## 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: Could you elaborate on what is wrong with the previous implementation? If there is a bug, would it be possible to reproduce it in a unit test? -- 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