Closed
Description
https://checkstyle.org/config_annotation.html#SuppressWarningsHolder
$ cat Test.java
class Test {
@SuppressWarnings("paramnum")
public void needsLotsOfParameters( int a,
int b, int c, int d, int e, int f, int g, int h) {
// ...
}
}
$ cat config.xml
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
<property name="charset" value="UTF-8" />
<module name="TreeWalker">
<module name="ParameterNumber">
</module>
<module name="SuppressWarningsHolder">
<property name="aliasList" value="ParameterNumber=paramnum" />
</module>
</module>
<module name="SuppressWarningsFilter" />
</module>
$ java -jar checkstyle-10.1-all.jar -c config.xml Test.java
Starting audit...
[ERROR] /home/kevin/Desktop/C_Style/Test.java:4:15: More than 7 parameters (found 8). [ParameterNumber]
Audit done.
Expected: no violation.
workaround is to use fully qualified name of Check.
see details - #11542 (comment)