Skip to content

Commit d19f0b5

Browse files
jojoldufmbenhassine
authored andcommitted
Replace ArrayList with LinkedList in ListItemReader
Issue #3782
1 parent 50cd6fe commit d19f0b5

File tree

1 file changed

+5
-4
lines changed
  • spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support

1 file changed

+5
-4
lines changed

spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/ListItemReader.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2006-2019 the original author or authors.
2+
* Copyright 2006-2021 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,7 +16,7 @@
1616

1717
package org.springframework.batch.item.support;
1818

19-
import java.util.ArrayList;
19+
import java.util.LinkedList;
2020
import java.util.List;
2121

2222
import org.springframework.aop.support.AopUtils;
@@ -27,7 +27,8 @@
2727
* An {@link ItemReader} that pulls data from a list. Useful for testing.
2828
*
2929
* @author Dave Syer
30-
*
30+
* @author jojoldu
31+
*
3132
*/
3233
public class ListItemReader<T> implements ItemReader<T> {
3334

@@ -40,7 +41,7 @@ public ListItemReader(List<T> list) {
4041
this.list = list;
4142
}
4243
else {
43-
this.list = new ArrayList<>(list);
44+
this.list = new LinkedList<>(list);
4445
}
4546
}
4647

0 commit comments

Comments
 (0)