From 43b31ae89c9ad613a49cc89ef10a9f8e5f3f0955 Mon Sep 17 00:00:00 2001 From: Mahmoud Ben Hassine Date: Mon, 21 Oct 2019 11:43:58 +0200 Subject: [PATCH] Make the list of streams final in CompositeItemStream Resolves BATCH-1969 --- .../batch/item/support/CompositeItemStream.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/CompositeItemStream.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/CompositeItemStream.java index 8f397f501..6bc664129 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/CompositeItemStream.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/CompositeItemStream.java @@ -31,7 +31,7 @@ import org.springframework.batch.item.ItemStreamException; */ public class CompositeItemStream implements ItemStream { - private List streams = new ArrayList<>(); + private final List streams = new ArrayList<>(); /** * Public setter for the {@link ItemStream}s. @@ -39,7 +39,7 @@ public class CompositeItemStream implements ItemStream { * @param streams array of {@link ItemStream}. */ public void setStreams(ItemStream[] streams) { - this.streams = Arrays.asList(streams); + this.streams.addAll(Arrays.asList(streams)); } /**