A RetroSearch Logo

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

Search Query:

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

[java] UnusedFormalParameter doesn't consider anonymous classes · Issue #3618 · pmd/pmd · GitHub

Affects PMD Version: 6.40.0

Rule: UnusedFormalParameter

Description:

Methods in anonymous classes are not considered.

Code Sample demonstrating the issue:

class Impl {
    public void m4() {
        Object o = new Object() {
            private void m5(int arg1) { } // unsed formal parameter
            public boolean equals(Object other) { m5(0); return false; }
        };
        o.equals(o);
    }
}

Expected outcome:

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


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