A RetroSearch Logo

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

Search Query:

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

[java] JavaRuleViolation reports wrong class name · Issue #2212 · pmd/pmd · GitHub

Affects PMD Version: 6.20.0

Description:

In some cases, the reported class is wrong. This might be a regression of #2105 .

Code Sample demonstrating the issue:

package pkg;
public class Foo {
    int a;
}

If e.g. UnusedField is reported on the node "FieldDeclaration", then the resulting class name is "Foo$Foo" instead of just "Foo".

<violation beginline="3" endline="3" begincolumn="4" endcolumn="9" rule="UnusedPrivateField" ruleset="Best Practices" package="pkg" class="Foo$Foo" variable="a" externalInfoUrl="https://pmd.github.io/pmd-6.20.0/pmd_rules_java_bestpractices.html#unusedprivatefield" priority="3">
 Avoid unused private fields such as 'a'.
 </violation>

Note, that this only affects nodes, the are descendants of the class declaration. If the violation is created directly on the class node, then the class name is fine.

Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other]


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