RESOLVED - BATCH-1569: MultiResourceItemReader.getCurrentResource cause java.lang.ArrayIndexOutOfBoundsException when .read() was not called
This commit is contained in:
@@ -95,9 +95,7 @@ public class MultiResourceItemReader<T> implements ItemReader<T>, ItemStream {
|
||||
delegate.open(new ExecutionContext());
|
||||
}
|
||||
|
||||
T item;
|
||||
item = readNextItem();
|
||||
return item;
|
||||
return readNextItem();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -209,7 +207,7 @@ public class MultiResourceItemReader<T> implements ItemReader<T>, ItemStream {
|
||||
}
|
||||
|
||||
public Resource getCurrentResource() {
|
||||
if (currentResource >= resources.length) {
|
||||
if (currentResource >= resources.length || currentResource < 0) {
|
||||
return null;
|
||||
}
|
||||
return resources[currentResource];
|
||||
|
||||
Reference in New Issue
Block a user