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 193195 - @Override need some fixers
Summary: @Override need some fixers
Status: RESOLVED DUPLICATE of bug 222342
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 7.0
Hardware: PC Windows Vista
: P3 normal (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-09 22:53 UTC by Chiana
Modified: 2013-01-03 20:52 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chiana 2010-12-09 22:53:53 UTC
[ BUILD # : 20101208 ]
[ JDK VERSION : 1.6.22 ]

If you have an overridden interface like this;

class Clz 
          extends Nothing 
          implements ClzInt {

  public void method() {
    doNothing();
  }
}

and...

interface ClzInt {
  public void method();
}

then the ide will quite nicely suggest that you insert an @Override even thou
it is not required, it even assist you with the task on the linenumberbar to
the left, that is good, very good... but... If you remove the interface so that
the method no longer overrides anything it will show as an error only, no
helpful hint! One would like the same assistance in removing the @Override as
in adding it...
There are other cases where this is true too...
Comment 1 Jan Lahoda 2010-12-10 13:57:51 UTC
If the @Override annotation is on a line by itself, it can easily be removed using Delete Line action (Ctrl-E in the default keymap).
Comment 2 Chiana 2010-12-10 14:35:48 UTC
Yes, I'm aware of that, but I do a lot of programming with the mouse only (cutting and pasting from a palette) lazily thrown on the couch and the keyboard some meter or so away... AND it is easier to click the icon and select "remove annotation" (or something similar) than pasting over it, right-click and select delete. But you are right, I should have filed this as an enhancement and not a bug...
Comment 3 markiewb 2012-10-02 22:20:52 UTC
Currently there would be an error saying "method does not override or implement a method from a supertype". 

Why don't you add a fixable hint for this, which removes the @Override-annotation? Could be easy with some hint-creation knowledge.
Comment 4 markiewb 2013-01-03 20:52:32 UTC

*** This bug has been marked as a duplicate of bug 222342 ***