From fa6c3f1f552a75ea4ec36345ed1c26f6e192847d Mon Sep 17 00:00:00 2001 From: banseok1216 Date: Thu, 27 Nov 2025 17:29:51 +0900 Subject: [PATCH] Replace CopyOnWriteArrayList with ArrayList in PagingItemReaders Signed-off-by: banseok1216 --- .../infrastructure/item/database/JdbcPagingItemReader.java | 3 +-- .../infrastructure/item/database/JpaPagingItemReader.java | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/infrastructure/item/database/JdbcPagingItemReader.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/infrastructure/item/database/JdbcPagingItemReader.java index decc4099c6..9f8f206e5b 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/infrastructure/item/database/JdbcPagingItemReader.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/infrastructure/item/database/JdbcPagingItemReader.java @@ -25,7 +25,6 @@ import java.util.Map; import java.util.SortedMap; import java.util.TreeMap; -import java.util.concurrent.CopyOnWriteArrayList; import javax.sql.DataSource; @@ -184,7 +183,7 @@ public void afterPropertiesSet() throws Exception { @Override protected void doReadPage() { if (results == null) { - results = new CopyOnWriteArrayList<>(); + results = new ArrayList<>(); } else { results.clear(); diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/infrastructure/item/database/JpaPagingItemReader.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/infrastructure/item/database/JpaPagingItemReader.java index a3b13c6fd9..bd49f7c7f1 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/infrastructure/item/database/JpaPagingItemReader.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/infrastructure/item/database/JpaPagingItemReader.java @@ -16,10 +16,10 @@ package org.springframework.batch.infrastructure.item.database; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.concurrent.CopyOnWriteArrayList; import jakarta.persistence.EntityManager; import jakarta.persistence.EntityManagerFactory; @@ -217,7 +217,7 @@ protected void doReadPage() { } if (results == null) { - results = new CopyOnWriteArrayList<>(); + results = new ArrayList<>(); } else { results.clear();