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
Change StepBuilerHelper#enhance parameter type to AbstractStep #4220
Conversation
Thank you for the PR. Could you please rebase it in on the latest Any reason you renamed
Please open a separate PR for this enhancement. Thank you upfront. |
57505ba
to
eaabd24
Compare
Rebased and add |
Thank you for the update. I did not review this PR in details until you rebased it. Looking at the change, you moved the --builder.enhance(step);
++step.enhance(commonStepProperties); That method is actually configuring/enhancing the step with some properties, and I believe this is the role of the builder, not the step itself. The step can provide setters for its properties, but not a public method In my opinion, the way to remove the cast to
So I guess the way to remove the cast can be achieved like: --protected void enhance(Step target) {
++protected void enhance(AbstractStep target) {
--- if (target instanceOf AbstractStep) {
--- }
} I tried this change on the |
Make sense. I thought changing parameter type to |
Yes please. It should be good to merge if all tests pass. Thank you upfront! |
eaabd24
to
b4a6658
Compare
Done |
Rebased and merged as 3385a19. Thank you for your contribution! |
This commit moves
StepBuilerHelper#enhance
method toAbstractStep
. It removes unnecessary casting toAbstractStep
.Currently, changing argument type to
AbstractStep
is enough. But until 4.3.x, there were another casting code (It’s been removed by 7c8fb17). But there may be similar cases in future.By moving enhance method to AbstractStep, we can use like followings for those cases.
This also can be applied to JobBuilderHelper.
I also extracted
StepProperties
to prevent dependency cycle (org.springframework.batch.core.step.builder <-> org.springframework.batch.core.step)