frankvicky commented on code in PR #20097: URL: https://github.com/apache/kafka/pull/20097#discussion_r2193942256
########## group-coordinator/src/main/java/org/apache/kafka/coordinator/group/modern/MemberAssignmentImpl.java: ########## @@ -25,15 +25,12 @@ /** * The partition assignment for a modern group member. + * + * @param partitions The partitions assigned to this member keyed by topicId. */ -public class MemberAssignmentImpl implements MemberAssignment { - /** - * The partitions assigned to this member keyed by topicId. - */ - private final Map<Uuid, Set<Integer>> partitions; - - public MemberAssignmentImpl(Map<Uuid, Set<Integer>> partitions) { - this.partitions = Objects.requireNonNull(partitions); +public record MemberAssignmentImpl(Map<Uuid, Set<Integer>> partitions) implements MemberAssignment { + public MemberAssignmentImpl { + Objects.requireNonNull(partitions); Review Comment: Should we wrap the `partitions` with `Collections.unmodifiableMap`? This could ensure the consistency of `hashCode`. -- 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