-
Notifications
You must be signed in to change notification settings - Fork 75
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
onLoad(FlowExecutionOwner)
is meant to throw IOException
#201
Conversation
I think |
workflow-api-plugin/src/main/java/org/jenkinsci/plugins/workflow/flow/FlowExecutionOwner.java Line 128 in 7f5f175
workflow-api-plugin/src/main/java/org/jenkinsci/plugins/workflow/flow/FlowExecutionOwner.java Line 179 in 7f5f175
|
@offa please disable whichever IDE suggestion you may have to automatically strip unthrown exceptions as this is not safe to use without human inspection in general. |
Yeah, I tend to ignore this IDE suggestion in general. The one case where I have found it useful is for removing e.g. |
Sorry for introducing a regression with my PR; I've checked changes, ran tests etc. but didn't verify downstream consumers like cps. In my personal opinion declared but not thrown exceptions should get removed as they lie to the caller, may reduce readability and force them to write additional code to handle situations that wont ever appear or are impossible. Without breaking anything of course – unlike here. Again, my opinion and it's totally fine to disagree. If there's a consensus or recommendation to leave not-thrown exceptions alone I'm fully ok with that. Thanks @jglick for fixing it up. |
No worries, everyone does sometimes! This only caused a source incompatibiilty (no effect on Jenkins users updating).
In some cases sure. But not if the method is intended to be overridden outside the module. Or if it is a test which will quite possibly sooner or later wind up throwing a checked exception. Or if the method is part of some public API and there is the notion to later change its body to something that might throw that exception. Or if there are some callers (in another module) which would no longer compile because they currently |
Reverting an incorrect change (I suppose caused by unvalidated use of some refactoring tool by @offa) from #185.