A RetroSearch Logo

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

Search Query:

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

[java] AvoidReassigningParameters reports violations on wrong line numbers · Issue #3254 · pmd/pmd · GitHub

Affects PMD Version: 6.34.0

Description:

The rule AvoidReassigningParameters reports each assignment. But the line reported is the declaration of the parameter instead of the assignment.

This is not helpful. Consider the example below with one parameter. Either only one violation should be reported at the declaration of the parameter or two violations on the two lines of the assignments.

Code Sample demonstrating the issue:

public class AvoidReassigningParameters {
    public void a(String b) {  // line 2: here are two violations reported
        b = "1";               // line 3: no violation, but expected
        b = "2";               // line 4: no violation, but expected
    }
}

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