chia7712 commented on code in PR #22060:
URL: https://github.com/apache/kafka/pull/22060#discussion_r3329774644


##########
clients/src/main/java/org/apache/kafka/common/security/ssl/SslFactory.java:
##########
@@ -372,7 +371,7 @@ private static void 
ensureCompatibleSANs(List<CertificateEntries> newEntries, Li
             this.subjectPrincipal = cert.getSubjectX500Principal();
             Collection<List<?>> altNames = cert.getSubjectAlternativeNames();
             // use a set for comparison
-            this.subjectAltNames = altNames != null ? new HashSet<>(altNames) 
: Collections.emptySet();
+            this.subjectAltNames = altNames != null ? new HashSet<>(altNames) 
: Set.of();

Review Comment:
   It looks a bit fishy to me since it mixes mutable and immutable collections. 
Maybe we could use `Set.copyOf(altNames)` instead?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to