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
Description:
PMD allows violation suppression through the
@SuppressWarningsannotation, 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:
Running PMD through: any