-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed
Description
https://checkstyle.org/config_coding.html#UnnecessaryParentheses
$ cat TestClass.java
public class TestClass {
public static boolean is(Class<?> clazz) {
return true
&& (test(clazz)); // no violation
}
public static boolean test(Class<?> clazz) {
return true;
}
}
$ cat TestConfig.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="UnnecessaryParentheses"/>
</module>
</module>
$ java -jar checkstyle-10.2-all.jar -c TestConfig.xml TestClass.java
Starting audit...
Audit done.
Expected a violation on line 4.
PMD reported the violation.