j-easy / easy-batch

The simple, stupid batch framework for Java
https://github.com/j-easy/easy-batch/wiki
MIT License
611 stars 199 forks source link

Allows a job with a MultiFileRecordReader and no input files not to fail #397

Open okayawright opened 3 years ago

okayawright commented 3 years ago

https://github.com/j-easy/easy-batch/blob/647ce811fc1ada476ceef4f48a2f8523367a4892/easy-batch-core/src/main/java/org/jeasy/batch/core/reader/AbstractMultiFileRecordReader.java#L77

I believe the line could be changed to :

currentFile = iterator.hasNext() ? iterator.next() : null;

in order to allow a job with no input files not to fail, just to report as COMPLETE even if it didn't process anything