A RetroSearch Logo

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

Search Query:

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

[java] Examples in documentation of MethodArgumentCanBeFinal do not trigger the rule · Issue #4779 · pmd/pmd · GitHub

Affects PMD Version:7.0.0-rc4

Rule:MethodArgumentCouldBeFinal
https://docs.pmd-code.org/latest/pmd_rules_java_codestyle.html#methodargumentcouldbefinal

Description:
According to the rule description, when defining a method with an empty body, the method's parameters should be marked as 'final.' However, the provided sample code, which meets the conditions described by the rule, is not flagged as a violation. This discrepancy indicates a false negative in the PMD analysis.

Code Sample demonstrating the issue:

public class Foo{
    public void foo1 (String param) {  //should report violation

    }
}

Expected outcome:

PMD should report a violation at line 2, but doesn't. This is a false-negative.

Running PMD through: [CLI]


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