A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pmd/pmd/issues/1056 below:

[java] Property ignoredAnnotations does not work for SingularField and ImmutableField · Issue #1056 · pmd/pmd · GitHub

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