This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 255968

Summary: Warning "Overridable method call in constructor" for final classes
Product: java Reporter: mgoe <mgoe>
Component: HintsAssignee: Svata Dedic <sdedic>
Status: RESOLVED FIXED    
Severity: normal CC: in-ws5, Mat2095
Priority: P3    
Version: 8.1   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

Description mgoe 2015-10-16 08:03:01 UTC
A warning icon "Overridable method call in constructor" is shown for final classes which is wrong because in final classes no method can be overwritten.
Comment 1 in-ws5 2016-02-04 13:53:29 UTC
(In reply to mgoe from comment #0)
> A warning icon "Overridable method call in constructor" is shown for final
> classes which is wrong because in final classes no method can be overwritten.

Confirmed, example code to produce this situation as follows:

public final class A extends B {

    public A() {
        this.test();
    }
}

class B {

    public void test() {

    }
}
Comment 2 Svata Dedic 2016-05-06 06:45:16 UTC
Aha, the code checks wrong classelement's modifiers all the time ;)
Fixed in jet-main#8e4012946463