Refactored PreAllocatedArray.java into a static method#6120
Refactored PreAllocatedArray.java into a static method#6120ArbaazKhan1 wants to merge 1 commit intoapache:mainfrom
Conversation
| } | ||
|
|
||
| @SuppressWarnings("unchecked") | ||
| public static <T> List<T> newPreallocatedList(int size) { |
There was a problem hiding this comment.
Should this be moved out of LocalityGroupUtil?
There's not really anything in this static method that's related to LocalityGroups.
Maybe it makes sense to have DataTypeUtil?
There was a problem hiding this comment.
I do agree that it shouldn't be in LocalityGroup but I wasn't too sure where else to put it
There was a problem hiding this comment.
LocalityGroup seemed the best since it uses the method and it seemed a little redundant to create a new class just for this method
There was a problem hiding this comment.
Could put it in a class named PreallocatedList with a single static method named create. Moving the informational naming from the static method to the class name. Then could call List<String> pl = PreallocatedList.create(10);
Closes issue #6083
I moved the new
newPreallocatedListstatic method intoLocalityGroupUtil, and updated the references from the original PreAllocatedArray class to the new method.