A RetroSearch Logo

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

Search Query:

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

[java] UnusedPrivateField cannot override ignored annotations property · Issue #2876 · pmd/pmd · GitHub

Description:

There is this rule: https://pmd.github.io/latest/pmd_rules_java_bestpractices.html#unusedprivatefield

By default this rule will ignore any classes which annotated with any of the mentioned annotations. Now, I would like to override this and I want PMD to ignore these classes only if they are marked with lombok @Getter or @Data but do not ignore when they are marked with @RequiredArgsConstructor for example:

So I did this in my rule set:

    <rule ref="category/java/bestpractices.xml/UnusedPrivateField">
        <properties>
            <property name="ignoredAnnotations" value="lombok.Getter|lombok.Data" />
        </properties>
    </rule>

However, this doesn't seem to work as the rule still doesn't trigger for a class which is only annotated with @RequiredArgsConstructor but not with @Data or @Getter. My impression is that when I override this property in my rule set it doesn't actually override the default list, instead it just extends it so @RequiredArgsConstructor is still part of the value. Is that right? Is it possible to completely override this property?


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