BATCH-1082: FlatFileItemReader.doClose() checks if the resource exists before trying to close it.
This commit is contained in:
@@ -211,8 +211,10 @@ public class FlatFileItemReader<T> extends AbstractItemCountingItemStreamItemRea
|
||||
@Override
|
||||
protected void doClose() throws Exception {
|
||||
lineCount = 0;
|
||||
reader.close();
|
||||
|
||||
if(resource.exists())
|
||||
{
|
||||
reader.close();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -115,7 +115,7 @@ public class FlatFileItemReaderTests {
|
||||
|
||||
reader.open(executionContext);
|
||||
assertNull(reader.read());
|
||||
|
||||
reader.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user