Skip to content

Commit 38ce224

Browse files
authored
Prefer ArrayList over LinkedList (#118)
Both the ArrayList and LinkedList keep the order of insertion, there is no need to use the LinkedList.
1 parent 7efdb20 commit 38ce224

File tree

1 file changed

+3
-3
lines changed
  • spring-batch-excel/src/main/java/org/springframework/batch/extensions/excel/poi

1 file changed

+3
-3
lines changed

spring-batch-excel/src/main/java/org/springframework/batch/extensions/excel/poi/PoiSheet.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2006-2021 the original author or authors.
2+
* Copyright 2006-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,8 +16,8 @@
1616

1717
package org.springframework.batch.extensions.excel.poi;
1818

19+
import java.util.ArrayList;
1920
import java.util.Iterator;
20-
import java.util.LinkedList;
2121
import java.util.List;
2222

2323
import org.apache.poi.ss.usermodel.Cell;
@@ -88,7 +88,7 @@ private String[] map(Row row) {
8888
if (row == null) {
8989
return null;
9090
}
91-
final List<String> cells = new LinkedList<>();
91+
final List<String> cells = new ArrayList<>();
9292
final int numberOfColumns = row.getLastCellNum();
9393

9494
for (int i = 0; i < numberOfColumns; i++) {

0 commit comments

Comments
 (0)