Closed
Description
Bug description
In Spring Batch 4.x DefaultJobParametersExtractor
used to copy its configured keys from JobParameters
when not contained in the ExecutionContext
. In 5.x, this broke. It will now only consider JobParameters
keys when useAllParentParameters
is set to true. In that case it will copy JobParameters indiscriminately.
Judging by the javadoc and parameter names, I reckon this is a bug and behavior should be reverted to its 4.x behavior.
Environment
Spring Batch 5.0.3 and also present in main branch.
Steps to reproduce
- Use a
DefaultJobParametersExtractor
withuseAllParentParameters = false
andkeys = ["jobParamKey"]
- Run getJobParameters for an ExecutionContext without
jobParamKey
set, and with parentJobParameters
containing a value forjobParamKey
- Observe that the created
JobParameters
does not have a value forjobParamKey
Expected behavior
I expected same behavior as in 4.x: jobParamKey
propagated to new JobParameters
.
Minimal Complete Reproducible example
I will attach create a MR containing test case shortly.