GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [java] AvoidReassigningParameters reports violations on wrong line numbers · Issue #3254 · pmd/pmd

[java] AvoidReassigningParameters reports violations on wrong line numbers #3254

New issue
Copy link
New issue
Copy link
Closed
#3255
Closed
[java] AvoidReassigningParameters reports violations on wrong line numbers#3254
#3255
Copy link
Assignees
adangel
Labels
a:bugPMD crashes or fails to analyse a file.
Milestone
6.35.0

Description

@adangel
adangel
opened on May 6, 2021
Issue body actions

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]

Activity

  1. adangel
    added
    a:bugPMD crashes or fails to analyse a file.
    on May 6, 2021
  2. adangel
    added this to the 6.35.0 milestone on May 6, 2021
  3. adangel
    self-assigned this
    on May 6, 2021
  4. adangel
    added a commit that references this issue on May 6, 2021

    [java] AvoidReassigningParameters reports violations on wrong line

    This issue will close once commit 9725409 is merged into the 'main' branch.
    9725409
  5. oowekyala
    closed this as completedin 9725409on May 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @adangel
    adangel

Labels

a:bugPMD crashes or fails to analyse a file.

Type

No type

Projects

No projects

    Milestone

    • 6.35.0

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.