mimaison commented on code in PR #15071:
URL: https://github.com/apache/kafka/pull/15071#discussion_r1442027962


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java:
##########
@@ -1079,8 +1077,7 @@ private void clearAll() {
         }
 
         private List<NetworkClientDelegate.UnsentRequest> 
drainPendingCommits() {
-            ArrayList<NetworkClientDelegate.UnsentRequest> res = new 
ArrayList<>();
-            
res.addAll(unsentOffsetCommits.stream().map(OffsetCommitRequestState::toUnsentRequest).collect(Collectors.toList()));
+            ArrayList<NetworkClientDelegate.UnsentRequest> res = new 
ArrayList<>(unsentOffsetCommits.stream().map(OffsetCommitRequestState::toUnsentRequest).collect(Collectors.toList()));

Review Comment:
   We can use `List` on the left



##########
trogdor/src/main/java/org/apache/kafka/trogdor/workload/TopicsSpec.java:
##########
@@ -67,8 +67,7 @@ public void set(String name, PartitionsSpec value) {
     }
 
     public TopicsSpec immutableCopy() {
-        HashMap<String, PartitionsSpec> mapCopy = new HashMap<>();
-        mapCopy.putAll(map);
+        HashMap<String, PartitionsSpec> mapCopy = new HashMap<>(map);

Review Comment:
   Can we use `Map` on the left side?



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