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 124205 - @Override inconsistency
Summary: @Override inconsistency
Status: RESOLVED DUPLICATE of bug 118928
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-18 16:54 UTC by matthies
Modified: 2008-01-08 06:36 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 matthies 2007-12-18 16:54:11 UTC
On the one hand, the "Implement all abstract methods" hint generates methods with an @Override annotation.
On the other hand, for an implementation of an abstract method no "Add @Override annotation" hint is shown, and the I-
in-green-circle editor annotation is shown rather than the O-in-green-circle one.
I beliebe this is inconsistent.

Java allows @Override annotations on methods implementing abstract methods, but not on methods implementing interface 
methods. This is somewhat controversial, and I suppose that's the reason why the "I" editor annotation and no "Add 
@Override annotation" hint is shown for methods implementing abstract methods. (This must have changed quite late in 
the 6.0 dev builds, I think.) But then the "Implement all abstract methods" hint shouldn't generate @Override 
annotations either. Pick one policy, and stick with it throughout the editor.

Since it's a contentious issue whether @Override annotations belong on methods that implement abstract methods, you 
might want to make the policy configurable and add a corresponding flag in the Options.
Comment 1 _ gtzabari 2008-01-08 06:36:21 UTC

*** This issue has been marked as a duplicate of 118928 ***