Support empty comments in FlatFileItemReaderBuilder

Previously, if supplying empty comments or no comments to comments() of the FlatFileItemReaderBuilder, the comments would be ignored and instead use the default comments "#" provided by the FlatFileItemReader.

Resolves BATCH-2837
This commit is contained in:
Drummond Dawson
2019-10-03 20:20:25 -04:00
committed by Mahmoud Ben Hassine
parent 5ee6699ce3
commit e5855c7e6b
2 changed files with 46 additions and 4 deletions

View File

@@ -512,10 +512,7 @@ public class FlatFileItemReaderBuilder<T> {
}
reader.setLinesToSkip(this.linesToSkip);
if(!this.comments.isEmpty()) {
reader.setComments(this.comments.toArray(new String[this.comments.size()]));
}
reader.setComments(this.comments.toArray(new String[this.comments.size()]));
reader.setSkippedLinesCallback(this.skippedLinesCallback);
reader.setRecordSeparatorPolicy(this.recordSeparatorPolicy);