cadonna commented on code in PR #15507:
URL: https://github.com/apache/kafka/pull/15507#discussion_r1521177424
##########
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:
I see one usage of this method and I suspect there is a reason the author
did not use `newArrayBacked(MAX_RECORDS_PER_USER_OP)`.
##########
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) {
- return new BoundedList<>(maxLength, new ArrayList<>(initialCapacity));
- }
-
- public BoundedList(int maxLength, List<E> underlying) {
Review Comment:
Wouldn't it be less intrusive to just make a copy of `underlying` instead of
removing the whole constructor?
--
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]