Affects PMD Version:
6.2.0
Rule:ImmutableField
and SingularField
Description:
Newly announced parameter ignoredAnnotations
is present in these rules, but it doesn't ignore any violations.
Method net.sourceforge.pmd.lang.java.rule.AbstractIgnoredAnnotationRule#hasIgnoredAnnotation
is used only in UnusedPrivateField
and UnusedPrivateMethod
rules and feature works well for them.
Code Sample demonstrating the issue:
<rule ref="category/java/design.xml/SingularField"> <properties> <property name="ignoredAnnotations" value="java.lang.Deprecated"/> </properties> </rule>
public class Source { @Deprecated private Object o; //violation! Object m() { o = new Object(); return o; } }
Running PMD through: Gradle
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