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


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/topics/InternalTopicManager.java:
##########
@@ -74,12 +76,16 @@ public static ConfiguredTopology configureTopics(LogContext 
logContext,
             Map<String, Integer> decidedPartitionCountsForInternalTopics =
                 decidePartitionCounts(logContext, topology, topicMetadata, 
copartitionGroupsBySubtopology, log);
 
-            final Map<String, ConfiguredSubtopology> configuredSubtopologies =
+            final SortedMap<String, ConfiguredSubtopology> 
configuredSubtopologies =
                 subtopologies.stream()
                     .collect(Collectors.toMap(
                         StreamsGroupTopologyValue.Subtopology::subtopologyId,
-                        x -> fromPersistedSubtopology(x, 
decidedPartitionCountsForInternalTopics))
-                    );
+                        x -> fromPersistedSubtopology(x, 
decidedPartitionCountsForInternalTopics),
+                        (v1, v2) -> {
+                            throw new 
RuntimeException(String.format("Duplicate key for values %s and %s", v1, v2));

Review Comment:
   The error message for duplicate keys should include the key itself. Update 
the message to: throw new RuntimeException(String.format("Duplicate key %s for 
values %s and %s", key, v1, v2));
   ```suggestion
                               throw new 
RuntimeException(String.format("Duplicate key %s for values %s and %s", v1, 
v2));
   ```



-- 
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

Reply via email to