spring-batch icon indicating copy to clipboard operation
spring-batch copied to clipboard

o.s.b.core.job.flow.support.StateTransition missing hash() and equals()-Function

Open neo4Play opened this issue 5 years ago • 1 comments

o.s.b.core.job.flow.support.SimpleFlow point to StateTransition in the variable transitionMap parameterized by Map<String, Set<StateTransition>>. We get duplicated entries in the Set by using o.s.b.core.job.builder.FlowJobBuilder but it doesn't leads to an error!

Sample:

final FlowJobBuilder flowJobBuilder = this.parentJobConfig.customJobBuilders()
		.get(jobName)
		.start(step1)
		.on(ExitStatus.FAILED.getExitCode())
		.fail()
		.on(ExitStatus.STOPPED.getExitCode())
		.stop()
		.next(step2)
		.on(ExitStatus.COMPLETED.getExitCode())
		.end()
		.on(ExitStatus.FAILED.getExitCode())
		.fail()
		.on(ExitStatus.STOPPED.getExitCode())
		.stop()
		.build();

The basic functions hash() and equals() would avoid the bad code smell!

neo4Play avatar Feb 27 '20 08:02 neo4Play