ChrisAHolland commented on code in PR #15507:
URL: https://github.com/apache/kafka/pull/15507#discussion_r1521727181


##########
server-common/src/main/java/org/apache/kafka/server/mutable/BoundedList.java:
##########
@@ -35,24 +35,12 @@ public class BoundedList<E> implements List<E> {
     private final int maxLength;
     private final List<E> underlying;
 
-    public static <E> BoundedList<E> newArrayBacked(int maxLength) {
-        return new BoundedList<>(maxLength, new ArrayList<>());
-    }
-
-    public static <E> BoundedList<E> newArrayBacked(int maxLength, int 
initialCapacity) {

Review Comment:
   Looking at the usage here, I can't see a reason why this would be desirable, 
maybe the intention was to have the option to save on same space until 
absolutely necessary? Although, as I mentioned in the PR description, this is 
not worth the resizing costs. Also, this method is guaranteed to add more 
records to the list than `ids.size()` as the method add elements in multiple 
places.



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

Reply via email to