From 7c10a0f8131c76decc9cb6c7cc07495294b98b79 Mon Sep 17 00:00:00 2001 From: Tobias Berse Date: Mon, 14 Oct 2024 15:13:17 +0200 Subject: [PATCH] Allow subclasses of items in CompositeItemReader's generics Resolves #https://github.com/spring-projects-experimental/spring-batch-experimental/issues/2 --- .../batch/item/support/CompositeItemReader.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/CompositeItemReader.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/CompositeItemReader.java index e9b5a72d07..06148a346c 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/CompositeItemReader.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/CompositeItemReader.java @@ -32,17 +32,17 @@ */ public class CompositeItemReader implements ItemStreamReader { - private final List> delegates; + private final List> delegates; - private final Iterator> delegatesIterator; + private final Iterator> delegatesIterator; - private ItemStreamReader currentDelegate; + private ItemStreamReader currentDelegate; /** * Create a new {@link CompositeItemReader}. * @param delegates the delegate readers to read data */ - public CompositeItemReader(List> delegates) { + public CompositeItemReader(List> delegates) { this.delegates = delegates; this.delegatesIterator = this.delegates.iterator(); this.currentDelegate = this.delegatesIterator.hasNext() ? this.delegatesIterator.next() : null; @@ -52,7 +52,7 @@ public CompositeItemReader(List> delegates) { // opening resources early for a long time @Override public void open(ExecutionContext executionContext) throws ItemStreamException { - for (ItemStreamReader delegate : delegates) { + for (ItemStreamReader delegate : delegates) { delegate.open(executionContext); } } @@ -79,7 +79,7 @@ public void update(ExecutionContext executionContext) throws ItemStreamException @Override public void close() throws ItemStreamException { - for (ItemStreamReader delegate : delegates) { + for (ItemStreamReader delegate : delegates) { delegate.close(); } }