Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible duplicate state transitions in flow definition #3674

Closed
neo4Play opened this issue Feb 27, 2020 · 2 comments
Closed

Possible duplicate state transitions in flow definition #3674

neo4Play opened this issue Feb 27, 2020 · 2 comments

Comments

@neo4Play
Copy link

neo4Play commented Feb 27, 2020

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!

@fmbenhassine fmbenhassine added the status: waiting-for-triage Issues that we did not analyse yet label Feb 28, 2020
@hyosyung
Copy link

Hi team, can I take this issue?

@fmbenhassine fmbenhassine added in: core and removed status: waiting-for-triage Issues that we did not analyse yet labels May 2, 2024
Kyoungwoong added a commit to Kyoungwoong/spring-batch that referenced this issue May 12, 2024
Implemented equals() and hashCode() methods to prevent duplicate entries in transitionMap.
Kyoungwoong added a commit to Kyoungwoong/spring-batch that referenced this issue May 12, 2024
Implemented equals() and hashCode() methods to prevent duplicate entries in transitionMap.

fix: spring-projects#3674
@Kyoungwoong
Copy link
Contributor

pr: #4590

@fmbenhassine fmbenhassine changed the title o.s.b.core.job.flow.support.StateTransition missing hash() and equals()-Function Possible duplicate state transitions in flow definition May 29, 2024
@fmbenhassine fmbenhassine added this to the 5.2.0-M1 milestone May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants