-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Pull #2291: Modernize codebase with Java improvements - Unnecessary throws
#2291
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
Conversation
b10c8fb
to
bf48163
Compare
impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelProcessor.java
Show resolved
Hide resolved
Modernize codebase with Java improvements - Unnecessary throws
Modernize codebase with Java improvements - Unnecessary throws
bf48163
to
01e5e53
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may lead to incompatibilities if someone overrides a protected method and actually throw one exception that you removed. No incompatible change in compat
modules is required.
new contract is not to throw; with checked it wont compile and runtime is always possible.
so undo in this module and then any good ? |
01e5e53
to
a84fac9
Compare
done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you remove a throws clause from a protected method, any class that overrides this method won't be able to throw that exception, so that's an API change.
Modernize codebase with Java improvements - Unnecessary throws
Unnecessary throws
how to fix this permanent @timtebeek ? We dont have checkstyle for this. Do we have the (local) I do not want to overload and spam PR´s like its done in rewrite. Ideally this breaks and fixes locally on dev´s machine/cost. Thank you so much for this tool. Its a great needed help. We enlight the code so much. This codebase is very smart as the code will format itself just like aimed in but, its still not capable of fixing all like imports. This we will cover with help of rewrite again. |
Thanks all! Indeed we should not be making changes to an API that was explicitly marked as protected with exceptions declared; |
* UnnecessaryThrows should not change API for protected methods For apache/maven#2291 Needs openrewrite/rewrite#5412 * Adjust logic following review
wip reopen: wait for bugfix release or rewrite. |
Pull #2291:
Modernize codebase with Java improvements - Unnecessary throws
Apply:
Prerequisite:
DefaultModelProcessor#read
#2292fix:

Ref:
Unnecessary throws
checkstyle/checkstyle#17005