From 38ce2245021c13dec293b2f8b3c37ef78b78047a Mon Sep 17 00:00:00 2001 From: Marten Deinum Date: Mon, 2 Oct 2023 16:18:54 +0200 Subject: [PATCH] Prefer ArrayList over LinkedList (#118) Both the ArrayList and LinkedList keep the order of insertion, there is no need to use the LinkedList. --- .../batch/extensions/excel/poi/PoiSheet.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spring-batch-excel/src/main/java/org/springframework/batch/extensions/excel/poi/PoiSheet.java b/spring-batch-excel/src/main/java/org/springframework/batch/extensions/excel/poi/PoiSheet.java index a28a725..f47938d 100644 --- a/spring-batch-excel/src/main/java/org/springframework/batch/extensions/excel/poi/PoiSheet.java +++ b/spring-batch-excel/src/main/java/org/springframework/batch/extensions/excel/poi/PoiSheet.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2021 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,8 +16,8 @@ package org.springframework.batch.extensions.excel.poi; +import java.util.ArrayList; import java.util.Iterator; -import java.util.LinkedList; import java.util.List; import org.apache.poi.ss.usermodel.Cell; @@ -88,7 +88,7 @@ class PoiSheet implements Sheet { if (row == null) { return null; } - final List cells = new LinkedList<>(); + final List cells = new ArrayList<>(); final int numberOfColumns = row.getLastCellNum(); for (int i = 0; i < numberOfColumns; i++) {