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 178983 - IDE incorrectly reports "method does not override or implement a method from a supertype"
Summary: IDE incorrectly reports "method does not override or implement a method from ...
Status: RESOLVED INCOMPLETE
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-22 10:31 UTC by swpalmer
Modified: 2017-06-22 18:35 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
ca class is also created in cube but no overriding is there and super function is useless (419 bytes, application/octet-stream)
2017-06-22 18:34 UTC, ayu
Details
no overriding shown (388 bytes, application/octet-stream)
2017-06-22 18:35 UTC, ayu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description swpalmer 2009-12-22 10:31:49 UTC
The IDE often marks errors on a couple of my @Override annonations.  It appears that the key to reproducing this is that the interface must be declared inside another class.

e.g. the class where the errors are reported looks like this:

public class A implements B, C.Callback, D.Callback {
   @Override
   public void methodA() {}

   @Override
   public void callbackC(Object x) {}
    
   @Override
   public void callbackD(Object x) {}
}

Where C and D look like:

public class C {
   public static interface Callback {
      public void callbackC(Object x);
   }
}   

public class D {
   public static interface Callback {
      public void callbackD(Object x);
   }
}   

In this case the methods inmy example named callbackC and callbackD will be tagged with an error on the @Override line with the message indicated in the subject "method does not override or implement a method from a supertype".

The code complies and runs fine so the problem appears to be how NB handles the nested interface declarations.
This has been a problem since at least 6.7, though the errors are reported intermittently so it was tricky to nail down - if they aren't flagged as errors I can make a change elsewhere in the file and then they will re-appear when I save.
Comment 1 Dusan Balek 2010-03-12 13:56:08 UTC
Above example seems to work fine in the current dev build.
Comment 2 swpalmer 2010-03-12 22:23:37 UTC
Thanks, this is still happening in Netbeans 6.9 build 201003120200, so I'm reopening.  I am participating in NetCat 6.9 so I will keep an eye on it.

At first I was editing the file where this occurs and the error didn't come up..  I then I triggered an update from subversion on the file and the bogus errors appear during the subsequent rescan.
Comment 3 Dusan Balek 2010-10-25 15:28:20 UTC
Sorry, but I still cannot reproduce the issue. Could you please create a simple test project and describe exact steps to reproduce? Thanks.
Comment 4 pavan.agrawal 2012-03-19 11:52:18 UTC
if you copy paste the code in new class, then @Override will give you the problem 

otherwise it will run well

it is working fine, when I wrote the code from my self

very strange behavior, IDE bug
Comment 5 chabinours 2012-07-11 13:12:00 UTC
I had a similar issue.

I was overwriting org.xml.sax.helpers.DefaultHandler with startelement endelement and characters and startelement wasn't recognized as an overwritten method.
(and it didn't call the method)

I'm on netbeans 6.1 java 6 

it was a inner class so I tried with a new class on his own but nothing.

But I figured out what was happening, I used fix import without checking as most of the time netbeans knows better than me what to import.

This time netbeans choose "import java.util.jar.Attributes" instead of "import org.xml.sax.Attributes" 

as only start element has atribute it was the only one not recognized. It was an odd error to solve as I had in the same project another class doing the same overwrite work and it was working perfectly fine

it's the first time I post here so sorry for any mistake
Comment 6 ayu 2017-06-22 18:34:16 UTC
Created attachment 164600 [details]
ca class is also created in cube but no overriding is there and super function is useless
Comment 7 ayu 2017-06-22 18:35:43 UTC
Created attachment 164601 [details]
no overriding shown