AndrewJSchofield commented on code in PR #19328:
URL: https://github.com/apache/kafka/pull/19328#discussion_r2027666958


##########
clients/src/main/java/org/apache/kafka/clients/admin/internals/ListShareGroupOffsetsHandler.java:
##########
@@ -84,19 +84,23 @@ public DescribeShareGroupOffsetsRequest.Builder 
buildBatchedRequest(int coordina
             DescribeShareGroupOffsetsRequestGroup requestGroup = new 
DescribeShareGroupOffsetsRequestGroup()
                 .setGroupId(groupId);
 
-            Map<String, List<Integer>> topicPartitionMap = new HashMap<>();
-            spec.topicPartitions().forEach(tp -> 
topicPartitionMap.computeIfAbsent(tp.topic(), t -> new 
LinkedList<>()).add(tp.partition()));
-
-            Map<String, DescribeShareGroupOffsetsRequestTopic> requestTopics = 
new HashMap<>();
-            for (TopicPartition tp : spec.topicPartitions()) {
-                requestTopics.computeIfAbsent(tp.topic(), t ->
-                        new DescribeShareGroupOffsetsRequestTopic()
-                            .setTopicName(tp.topic())
-                            .setPartitions(new LinkedList<>()))
-                    .partitions()
-                    .add(tp.partition());
+            if (spec.topicPartitions() != null) {
+                Map<String, List<Integer>> topicPartitionMap = new HashMap<>();
+                spec.topicPartitions().forEach(tp -> 
topicPartitionMap.computeIfAbsent(tp.topic(), t -> new 
LinkedList<>()).add(tp.partition()));

Review Comment:
   No particular reason I think. I've changed it to ArrayList but it's fairly 
arbitrary.



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