child of #14942
violate the non-use of the catch parameters. They should be unnamed.
Config
$ cat config.xml
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
<module name="TreeWalker">
<module name="UnusedCatchParameterShouldBeUnnamed"/>
</module>
</module>
Example
public class Test {
void test(Object obj) {
try {
int x = 1 / 0;
} catch (Exception e) { // violation
System.out.println("error");
}
try {
int x = 1 / 0;
} catch (Exception _) {
System.out.println("error");
}
}
}
Expected Output
$ java -jar checkstyle-10.19.0-all.jar -c config.xml Test.java
Starting audit...
[ERROR] D:\Test.java:5:28:Unused catch parameter should be unnamed [UnusedCatchParameterShouldBeUnnamed]
Audit done.
Checkstyle ends with 1 errors.
How we could suppress violations in this check for (ignore|ignored) naming convention
#15058 (comment)
child of #14942
violate the non-use of the catch parameters. They should be unnamed.
Config
Example
Expected Output
#15058 (comment)