RESOLVED - issue BATCH-1417: Error in FlatFileItemReader when RecordSeparatorPolicy.preProcess or readLine returns null
Throw FlatFileParseException if file ends in the middle of a record.
This commit is contained in:
@@ -180,7 +180,11 @@ public class FlatFileItemReader<T> extends AbstractItemCountingItemStreamItemRea
|
||||
String record = line;
|
||||
if (line != null) {
|
||||
while (line != null && !recordSeparatorPolicy.isEndOfRecord(record)) {
|
||||
record = recordSeparatorPolicy.preProcess(record) + (line = readLine());
|
||||
line = readLine();
|
||||
if (line==null) {
|
||||
throw new FlatFileParseException("Unexpected end of file before record complete", record, lineCount);
|
||||
}
|
||||
record = recordSeparatorPolicy.preProcess(record) + line;
|
||||
}
|
||||
}
|
||||
String logicalLine = recordSeparatorPolicy.postProcess(record);
|
||||
|
||||
Reference in New Issue
Block a user