chia7712 commented on code in PR #15847: URL: https://github.com/apache/kafka/pull/15847#discussion_r1589049952
########## group-coordinator/src/test/java/org/apache/kafka/coordinator/group/consumer/TargetAssignmentBuilderTest.java: ########## @@ -182,14 +172,16 @@ public TargetAssignmentBuilder.TargetAssignmentResult build() { if (updatedMemberOrNull == null) { memberSpecs.remove(memberId); } else { - ConsumerGroupMember member = members.get(memberId); - Assignment assignment; + Assignment assignment = targetAssignment.getOrDefault(memberId, Assignment.EMPTY); + // A new static member joins and needs to replace an existing departed one. - if (member == null && staticMembers.containsKey(updatedMemberOrNull.instanceId())) { - assignment = targetAssignment.getOrDefault(staticMembers.get(updatedMemberOrNull.instanceId()), Assignment.EMPTY); - } else { - assignment = targetAssignment.getOrDefault(memberId, Assignment.EMPTY); + if (updatedMemberOrNull.instanceId() != null) { Review Comment: Pardon me, why the code in `TargetAssignmentBuilderTestContext#build` are similar to `TargetAssignmentBuilder#build` ? -- 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