Skip to content

Commit 02524d7

Browse files
committed
Fix job/step configuration when no name is provided
Resolves #5027
1 parent 11ec7f1 commit 02524d7

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

spring-batch-core/src/main/java/org/springframework/batch/core/step/AbstractStep.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ public AbstractStep() {
9494
*/
9595
@Deprecated(since = "6.0", forRemoval = true)
9696
public AbstractStep(String name) {
97-
Assert.notNull(name, "Step name must not be null");
9897
this.name = name;
9998
}
10099

spring-batch-samples/src/main/java/org/springframework/batch/samples/helloworld/HelloWorldJobConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ public class HelloWorldJobConfiguration {
3131

3232
@Bean
3333
public Step step(JobRepository jobRepository) {
34-
return new StepBuilder("step", jobRepository).tasklet((contribution, chunkContext) -> {
34+
return new StepBuilder(jobRepository).tasklet((contribution, chunkContext) -> {
3535
System.out.println("Hello world!");
3636
return RepeatStatus.FINISHED;
3737
}).build();
3838
}
3939

4040
@Bean
4141
public Job job(JobRepository jobRepository, Step step) {
42-
return new JobBuilder("job", jobRepository).start(step).build();
42+
return new JobBuilder(jobRepository).start(step).build();
4343
}
4444

4545
}

0 commit comments

Comments
 (0)