[java] Refactor annotation suppression#1927
Merged
oowekyala merged 7 commits intoSep 25, 2019
Merged
Conversation
oowekyala
added a commit
that referenced
this pull request
Sep 24, 2019
* nspmd.lang.java.dfa * nspmd.lang.java.symboltable * Some of nspmd.lang.java.metrics The remaining failures are fixed by #1927
oowekyala
added a commit
to oowekyala/pmd
that referenced
this pull request
Sep 24, 2019
Generated by 🚫 Danger |
jsotuyod
reviewed
Sep 25, 2019
| } | ||
|
|
||
| /** | ||
| * @deprecated Used in only one deprecated rule, which is removed by pending PR #1772 |
Member
There was a problem hiding this comment.
#1772 is now merged… shall this method be removed altogether and deprecated in master?
Member
Author
Member
|
@oowekyala other than that one doubt this looks mergeable. We should also deprecate |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This removes the need for the Java
CanSuppressWarningsinterface, and decouples the AST from rules.See also this PR comment.
The implementation of the interface was duplicated 4 times, but we can use Annotatable to remove the duplication.
Relevant regression tests are in SuppressWarningsTest, which isn't touched by this PR.
TODO on master:
JavaRuleViolation::isSupressed: there's a typo in the method name, and it doesn't need to be publicAbstractJavaRule::isSuppressed. It seems like it's only used by one rule deprecated for removalNotes:
SuppressionGroup("unused")), which would make the suppression mechanism extensible, and also usable by end-users.