Skip to content

[java] MethodArgumentCouldBeFinal shouldn't report unused parameters #4512

@adangel

Description

@adangel

Affects PMD Version: 6.x

Rule: MethodArgumentCouldBeFinal

Description:

Similar like #4511: Unused formal parameters shouldn't be reported. This is a different problem UnusedFormalParameter

This has been found via #3123. It is already fixed with PMD 7.0.0-rc1.
Has been fixed with #3113.

Code Sample demonstrating the issue:

public class Foo {
    public static void main(String[] args) {}
}

Expected outcome:

PMD reports a violation at line 2, but that's wrong. That's a false positive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    a:false-positivePMD flags a piece of code that is not problematic

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions