You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2021/12/09 00:59:16 UTC

[GitHub] [iceberg] rdblue commented on a change in pull request #3689: Checkstyle:Add checkstyle rule to prevent using raw HashMap, HashSet, ArrayList

rdblue commented on a change in pull request #3689:
URL: https://github.com/apache/iceberg/pull/3689#discussion_r765356480



##########
File path: core/src/main/java/org/apache/iceberg/BaseFileScanTask.java
##########
@@ -117,7 +117,7 @@ public String toString() {
       this.offsets = ImmutableList.copyOf(offsetList);
       this.parentScanTask = parentScanTask;
       this.targetSplitSize = targetSplitSize;
-      this.splitSizes = new ArrayList<>(offsets.size());
+      this.splitSizes = Lists.newArrayListWithCapacity(offsets.size());

Review comment:
       It looks like most cases in this PR convert to `WithCapacity`, but we typically only use that when we know that the number of elements won't exceed the given size. Otherwise, we use `WithExpectedSize` to allocate some additional space. I think you have that guarantee/expectation here, but if you're converting to one or the other, I'd convert to `WithExpectedSize`.




-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org