A RetroSearch Logo

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

Search Query:

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

[java] UnusedPrivateField not triggering if @Value annotation present · Issue #1952 · pmd/pmd · GitHub

Rule: UnusedPrivateField

PMD 6.16 Java.

class MyClass {
  boolean var;
}

correctly produces category\java\bestpractices.xml\UnusedPrivateField warning. BUT:

@Component
class MyService implements IMyService {
  @Value("...")
  boolean unusedConfigVariable;
}

does not produce this warning. I understand that sometimes annotations make private fields usable somehow, but in this case they don't. Can you add a possibility to ignore @value annotation and produce warning?
Also some previous PMD version, maybe 6.0 produce UnusedPrivateField even if @value annotation present.


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