BATCH-1980 2.2.x

Same as https://github.com/spring-projects/spring-batch/pull/268 but for 2.2.x branch