Skip to content

Commit afa57b1

Browse files
committed
replaced map.containsKey with get and != null in MapStepRegistry
Resolves #4981 Signed-off-by: Thomas Krieger [email protected] Signed-off-by: ThomasKrieger <[email protected]>
1 parent 1f277ef commit afa57b1

File tree

1 file changed

+2
-2
lines changed
  • spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support

1 file changed

+2
-2
lines changed

spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/MapStepRegistry.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ public void unregisterStepsFromJob(String jobName) {
6565
public Step getStep(String jobName, String stepName) throws NoSuchJobException {
6666
Assert.notNull(jobName, "The job name cannot be null.");
6767
Assert.notNull(stepName, "The step name cannot be null.");
68-
if (!map.containsKey(jobName)) {
68+
final Map<String, Step> jobSteps = map.get(jobName);
69+
if (jobSteps == null) {
6970
throw new NoSuchJobException("No job configuration with the name [" + jobName + "] was registered");
7071
}
7172
else {
72-
final Map<String, Step> jobSteps = map.get(jobName);
7373
if (jobSteps.containsKey(stepName)) {
7474
return jobSteps.get(stepName);
7575
}

0 commit comments

Comments
 (0)