MultiResourceItemReader executes all or none of the ItemStream methods

If no resources are found to be passed to the delegate ItemStream,
ItemStream#open is not called.  This commit updates the close side to
not call the delegate's close method if the open was not called.

BATCH-2378
This commit is contained in:
Michael Minella
2015-05-15 15:09:25 -05:00
parent 02cfe20225
commit ab80c33a2a
2 changed files with 68 additions and 11 deletions

View File

@@ -150,7 +150,11 @@ public class MultiResourceItemReader<T> extends AbstractItemStreamItemReader<T>
@Override
public void close() throws ItemStreamException {
super.close();
delegate.close();
if(!this.noInput) {
delegate.close();
}
noInput = false;
}