A RetroSearch Logo

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

Search Query:

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

[java] ConstructorCallsOverridableMethod false positive when calling super method · Issue #1718 · pmd/pmd · GitHub

Affects PMD Version: 6.12.0
Rule: ConstructorCallsOverridableMethod
Running PMD through: PMD Eclipse Plugin version 4.1.0

Code Sample demonstrating the issue:

public class A {
    public void doA() {}
}

public class B extends A {
    public B() {
        super.doA();  // <-- PMD: Overridable method 'doA' called during object construction
    }

    @Override
    public void doA() {
        throw new UnsupportedOperationException();
    }
}

Description:

In B's constructor, PMD reports that an overridable method is called. However, it is a super method call. So I think it is a false positive.


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