gabriellefu commented on code in PR #23165:
URL: https://github.com/apache/kafka/pull/23165#discussion_r4187575618
##########
group-coordinator/group-coordinator-api/src/main/java/org/apache/kafka/coordinator/group/api/streams/assignor/GroupAssignment.java:
##########
@@ -36,11 +35,11 @@ public class GroupAssignment {
public GroupAssignment(
Map<String, MemberAssignment> members
) {
- this.members = Objects.requireNonNull(members);
+ this.members = Map.copyOf(members);
Review Comment:
This came from the review of #22788, @chia7712 pointed out that the other
public types from KIP-1357 expose unmodifiable collections, and @mjsax
suggested Map.copyOf() to make it unmodifiable. Rejecting null keys and values
is intentional, since a null member ID or MemberAssignment isn't a valid
assignment. The copy is one shallow copy of the member map, which is small next
to running the assignor.
--
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]