Yunyung commented on code in PR #20097:
URL: https://github.com/apache/kafka/pull/20097#discussion_r2189963542


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/TopologyMetadata.java:
##########
@@ -36,7 +36,7 @@
 public record TopologyMetadata(MetadataImage metadataImage, SortedMap<String, 
ConfiguredSubtopology> subtopologyMap) implements TopologyDescriber {
 
     public TopologyMetadata {
-        metadataImage = Objects.requireNonNull(metadataImage);
+        Objects.requireNonNull(metadataImage);
         subtopologyMap = 
Objects.requireNonNull(Collections.unmodifiableSortedMap(subtopologyMap));

Review Comment:
   If the passed `subtopologyMap` is null
   Current: Collections.unmodifiableSortedMap throws NPE (so 
Objects.requireNonNull never takes effect).
   After: Objects.requireNonNull throws NPE.
   
   Also, this results in a different stack trace if NPE.



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