Skip to content

[java] ConstructorCallsOverridableMethod ignores abstract methods #3351

@oowekyala

Description

@oowekyala

Affects PMD Version: 6.35.0

Rule:

Please provide the rule name and a link to the rule documentation:
https://pmd.github.io/latest/pmd_rules_java_errorprone.html#constructorcallsoverridablemethod

Description: The rule ignores abstract methods:

<description>ignore abstract methods</description>
<expected-problems>0</expected-problems>

This looks contrary to what the rule is supposed to do.

Code Sample demonstrating the issue:

public class Foo {
    public Foo() {
        bar();
    }
    abstract void bar();
}

Expected outcome:

PMD should report a violation but doesn't. This is a false-negative.

Running PMD through: any

Metadata

Metadata

Assignees

No one assigned

    Labels

    a:false-negativePMD doesn't flag a problematic piece of code

    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