machi1990 commented on code in PR #13966:
URL: https://github.com/apache/kafka/pull/13966#discussion_r1254374926


##########
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:
   >  I am not sure about the Objects.requireNonNull though.
   
   can you expand on this @dajac ?
   
   > As this file is only used in tests, it would also make sense to move it to 
the test source tree.
   
   I am okay with this. Will we want to keep the added unit test in this case, 
any thoughts? @dajac @divijvaidya 



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