-
Notifications
You must be signed in to change notification settings - Fork 41.1k
Support Ordered and @Order for exit code generation #30457
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
Support Ordered and @Order for exit code generation #30457
Conversation
…efore #getExitCode
Thanks for the proposal. Unfortunately, I think this will cause some confusion. We have tests for this behaviour: Lines 64 to 80 in 6865f1f
Ordering these generators would make no difference to the exit code that's returned. The only place where ordering would make a difference is if it changed the first generator to return a non-zero value. That non-zero value will decide if the returned code is positive or negative. The other generators will then be called and the value that's further from zero in the direction determined by the first non-zero value will be returned. Given the above, I don't think we should add ordering support as you have proposed here. We could, perhaps, consider it in combination with a change to return the first non-zero value. That would be a breaking change so we'd have to make it with some care. I'll flag this for a forthcoming team meeting so that we can discuss our options. |
Combine order with 'return the first non-zero value' will be a greate idea, it is easy to understand.
It seems that the 'positive or negative' of first generator value would not change the return value. base:
the 'positive or negative' would not change:
order does:
|
You're right. I'd misread the code. Thanks for the correction. |
We discussed this today and we'd like to order the |
…and return the first non-zero value.
…and return the first non-zero value.
@philwebb Thanks for your response. this pr is updated, does this work for the new logic: ’order the ExitCodeGenerator beans then return the first non-zero result‘. |
Thanks very much, @dugenkui03. |
Describing Your Changes
Different order in
ExitCodeGenerators#generators
will lead to different exitCode. I suggest add ‘order’ support in order to sortExitCodeGenerators#generators
byOrdered
and@Order
.