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 269751 - Warning on overridable methods in a final class
Summary: Warning on overridable methods in a final class
Status: NEW
Alias: None
Product: ide
Classification: Unclassified
Component: Code (show other bugs)
Version: 8.1
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: issues@ide
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-05 22:58 UTC by jjg
Modified: 2017-02-05 22:58 UTC (History)
0 users

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 jjg 2017-02-05 22:58:44 UTC
NetBeans can give a warning if an overridable method is called from a constructor. That's OK.  One way to "disable" the warning is to locally override the method with a final method.

I would expect to be able to do the same by making the entire class final, which would prevent any subtype being created, hence all methods become implicitly final and non-overridable. In this case, I would expect that warning to be suppressed, but it is not.