-
Notifications
You must be signed in to change notification settings - Fork 57
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
RemoveUnusedPrivateMethods
should ignore class annotated with @SupressWarning("unused")
#293
RemoveUnusedPrivateMethods
should ignore class annotated with @SupressWarning("unused")
#293
Conversation
Thanks a lot for the start @Dinozavvvr ! As indicated in the issue we'll likely want to add an override of rewrite-static-analysis/src/main/java/org/openrewrite/staticanalysis/RemoveUnusedPrivateMethods.java Lines 55 to 57 in b7b1bd1
|
@timtebeek thank you a lot for your suggestion! |
…ssue. Added solution
@timtebeek I found that solution based on visiting J.ClassDeclaration ignores nested classes (I'm not sure should it or not), so if is it I will move this check to visitMethodDeclaration |
…ssue. Renamed tests
…ssue. Some changes
Did it |
…supress-warning-on-class
Great to see you've worked this out @Dinozavvvr ! I've added a small polishing commit to better fit in with our code conventions. Seems like a handy pattern to limit recipe execution by looking for suppressed warnings. We might just want to apply that in a few more cases, or pull this up to a higher level even. Neat stuff! |
RemoveUnusedPrivateMethods
should ignore class annotated with @SupressWarning("unused")
Fix #294