Skip to content

Commit 980ff7b

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 980ff7b

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.
@@ -188,7 +189,7 @@ public JobExecution start(Job job, JobParameters jobParameters)
188189
Assert.notNull(job, "The Job must not be null.");
189190
Assert.notNull(jobParameters, "The JobParameters must not be null.");
190191
if (job.getJobParametersIncrementer() != null) {
191-
if (logger.isWarnEnabled()) {
192+
if (!jobParameters.isEmpty() && 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.",
194195
job.getName(), jobParameters));

0 commit comments

Comments
 (0)