mimaison commented on code in PR #22122:
URL: https://github.com/apache/kafka/pull/22122#discussion_r3442742137


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:
##########
@@ -3035,11 +3035,11 @@ static Map<Uuid, InitMapValue> combineInitMaps(
         combinedTopicIdSet.addAll(initializingSet);
 
         for (Uuid topicId : combinedTopicIdSet) {
-            Set<Integer> initializedPartitions = 
initialized.containsKey(topicId) ? initialized.get(topicId).partitions() : new 
HashSet<>();
-            long timestamp = initialized.containsKey(topicId) ? 
initialized.get(topicId).timestamp() : -1;
-            String name = initialized.containsKey(topicId) ? 
initialized.get(topicId).name() : "UNKNOWN";
+            InitMapValue initializedValue = initialized.get(topicId);
+            Set<Integer> finalPartitions = initializedValue != null ? new 
HashSet<>(initializedValue.partitions()) : new HashSet<>();
+            long timestamp = initializedValue != null ? 
initializedValue.timestamp() : -1;
+            String name = initializedValue != null ? initializedValue.name() : 
"UNKNOWN";

Review Comment:
   Could we do something similar in the `if` block just below?
   ```
   if (initializingSet.contains(topicId)) {
       InitMapValue initializingValue = initializing.get(topicId);
       ...
   ```
   



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