frankvicky commented on code in PR #16250:
URL: https://github.com/apache/kafka/pull/16250#discussion_r1635795430


##########
clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:
##########
@@ -2760,9 +2760,19 @@ void handleFailure(Throwable throwable) {
             }, now);
         }
 
-        return new DescribeConfigsResult(new 
HashMap<>(nodeFutures.entrySet().stream()
+        return new DescribeConfigsResult(
+            nodeFutures.entrySet()
+                .stream()
                 .flatMap(x -> x.getValue().entrySet().stream())
-                .collect(Collectors.toMap(Map.Entry::getKey, 
Map.Entry::getValue))));
+                .collect(Collectors.toMap(
+                    Map.Entry::getKey,
+                    Map.Entry::getValue,
+                    (oldValue, newValue) -> {
+                        throw new 
IllegalStateException(String.format("Duplicate key for values: %s and %s", 
oldValue, newValue));

Review Comment:
   Sounds good, I will do that.



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