Copilot commented on code in PR #18864:
URL: https://github.com/apache/kafka/pull/18864#discussion_r1954316774


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/SimpleAssignor.java:
##########
@@ -111,12 +292,41 @@ private Map<Uuid, Set<Integer>> computeTargetPartitions(
                 );
             }
 
-            Set<Integer> partitions = new HashSet<>();
             for (int i = 0; i < numPartitions; i++) {
-                partitions.add(i);
+                targetPartitions.add(new TargetPartition(topicId, i));
             }
-            targetPartitions.put(topicId, partitions);
         });
         return targetPartitions;
     }
+
+    static class TargetPartition {
+        Uuid topicId;

Review Comment:
   The 'topicId' field should be declared as 'final' to make the 
'TargetPartition' class immutable.
   ```suggestion
           final Uuid 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