ganesh-sadanala commented on code in PR #16169: URL: https://github.com/apache/kafka/pull/16169#discussion_r1623637352
########## clients/src/test/java/org/apache/kafka/common/network/DefaultChannelMetadataRegistry.java: ########## @@ -22,9 +22,10 @@ public class DefaultChannelMetadataRegistry implements ChannelMetadataRegistry { @Override public void registerCipherInformation(final CipherInformation cipherInformation) { - if (this.cipherInformation != null) { - this.cipherInformation = cipherInformation; + if (cipherInformation == null) { + throw new IllegalArgumentException("cipherInformation cannot be null"); Review Comment: I see that `SelectorChannelMetadataRegistry#registerCipherInformation` does not throw any such exception. The proposed change for `DefaultChannelMetadataRegistry` is because it is only used in running test cases, not for production. @divijvaidya @dajac You want to add anything? -- 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