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 - Warning "Overridable method call in constructor" for final classes
Summary: Warning "Overridable method call in constructor" for final classes
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.1
Hardware: PC Linux
: P3 normal with 4 votes (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-16 08:03 UTC by mgoe
Modified: 2016-05-06 06:45 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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