gabriellefu opened a new pull request, #22970: URL: https://github.com/apache/kafka/pull/22970
## Changes - `MemberMetadataAndStateImpl` now wraps the nested collections of `activeTasks`, `standbyTasks`, `warmupTasks`, `taskOffsets`, and `taskEndOffsets`. - `GroupSpecImpl` now wraps both `members` and `configs`, and the now-redundant wrapping in `TargetAssignmentBuilder` is removed so immutability is enforced by the type rather than at each call site. - `MockAssignor` now deep-copies the active task sets it grows. It previously relied on input sets being mutable (`new HashMap<>(...)` followed by `computeIfAbsent(...).add(...)`), which now throws. - The read-only contract is now documented on `GroupSpec#configs`, `MemberAssignmentMetadata#clientTags`, and `MemberAssignmentState`. ## Testing - `TargetAssignmentBuilderTest#testCreateMemberMetadataAndStateReturnsUnmodifiableCollections` builds a member and its reported offsets from mutable collections, asserts that every map and nested collection exposed to the assignor rejects mutation, and verifies that the member’s own tasks remain unchanged. - `GroupSpecImplTest#testMembersAndConfigsAreUnmodifiable` covers both `members()` and `configs()`. - Both new tests fail against the previous implementation and pass with this change. - `MockAssignorTest` and `StickyTaskAssignorTest` pass unchanged, covering the two in-tree assignors against the tightened collections. -- 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]
