Skip to content

Commit e2dcee1

Browse files
committed
avoid warning when job parameters are empty with incrementer
Closes: gh-4914 Signed-off-by: Andrey Litvitski <[email protected]>
1 parent ff90464 commit e2dcee1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/SimpleJobOperator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
* @author Lucas Ward
8181
* @author Will Schipp
8282
* @author Mahmoud Ben Hassine
83+
* @author Andrey Litvitski
8384
* @since 2.0
8485
* @deprecated since 6.0 in favor of {@link TaskExecutorJobOperator}. Scheduled for
8586
* removal in 6.2 or later.
@@ -187,7 +188,7 @@ public JobExecution start(Job job, JobParameters jobParameters)
187188
JobRestartException, JobParametersInvalidException {
188189
Assert.notNull(job, "The Job must not be null.");
189190
Assert.notNull(jobParameters, "The JobParameters must not be null.");
190-
if (job.getJobParametersIncrementer() != null) {
191+
if (job.getJobParametersIncrementer() != null && !jobParameters.isEmpty()) {
191192
if (logger.isWarnEnabled()) {
192193
logger.warn(String.format(
193194
"Attempting to launch job '%s' which defines an incrementer with additional parameters={%s}. Those additional parameters will be ignored.",

0 commit comments

Comments
 (0)