Description:
PMD allows violation suppression through the @SuppressWarnings
annotation, but such suppression currently only allows for a literal even when constants are valid in the Java grammar.
Edge cases (initialization on a static block with arbitrary code), or calls to static methods can't be properly resolved, but the most basic case can certainly be with the current infrastructure.
Code Sample demonstrating the issue:
public class NewClass {
private final static String PMD_UNUSED_FORMAL_PARAMETER = "PMD.UnusedFormalParameter";
@SuppressWarnings(PMD_UNUSED_FORMAL_PARAMETER)
public void someMethod1(Object param) {
System.out.println("someMethod1");
}
}
Running PMD through: any
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4