Skip to content

Commit c56af7e

Browse files
committed
GH 4755: Fix wrong behavior of JobRepository with empty identifying job parameters
Signed-off-by: Seungyong Hong <[email protected]>
1 parent 5c07115 commit c56af7e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
* @author Will Schipp
6464
* @author Michael Minella
6565
* @author Mahmoud Ben Hassine
66+
* @author Seungyong Hong
6667
* @since 1.0
6768
* @see JobRepository
6869
* @see TaskExecutor
@@ -144,8 +145,7 @@ private JobExecution createJobExecution(Job job, JobParameters jobParameters)
144145
JobParameters allJobParameters = execution.getJobParameters();
145146
JobParameters identifyingJobParameters = new JobParameters(
146147
allJobParameters.getIdentifyingParameters());
147-
if (!identifyingJobParameters.isEmpty()
148-
&& (status == BatchStatus.COMPLETED || status == BatchStatus.ABANDONED)) {
148+
if (status == BatchStatus.COMPLETED || status == BatchStatus.ABANDONED) {
149149
throw new JobInstanceAlreadyCompleteException(
150150
"A job instance already exists and is complete for identifying parameters="
151151
+ identifyingJobParameters + ". If you want to run this job again, "

0 commit comments

Comments
 (0)