7531 Incorrect 'Class must implement method or be declared abstract' error

I have a class that compiles and runs OK, but IDEA flags it red with a 'Class must implement method or be declared abstract' error. The class extends one superclass and implements two interfaces. The method it complains about is implemented in the superclass of the superclass (grandparent), and is declared in the interface implemented by the grandparent. All legitimate code, and no method name clashes or conflicts.

The first time this happened, I deleted the caches and reopened the project. IDEA displayed the same error message in the same class, but for a different method of it's superclass (also correctly implemented in the superclass).

I closed IDEA again and deleted the caches, but when I reopened it, IDEA had reverted to flagging the class incorrect for not implementing the original method.

I can build and run the project, no problem, but the incorrect error flag persists for the class.

Who can rid me of this turbulent error?

22 comments

Hello Dave,

This problem will be fixed in next 7.0.2 EAP.

I have a class that compiles and runs OK, but IDEA flags it red with a
'Class must implement method or be declared abstract' error. The class
extends one superclass and implements two interfaces. The method it
complains about is implemented in the superclass of the superclass
(grandparent), and is declared in the interface implemented by the
grandparent. All legitimate code, and no method name clashes or
conflicts.

The first time this happened, I deleted the caches and reopened the
project. IDEA displayed the same error message in the same class, but
for a different method of it's superclass (also correctly implemented
in the superclass).

I closed IDEA again and deleted the caches, but when I reopened it,
IDEA had reverted to flagging the class incorrect for not implementing
the original method.

I can build and run the project, no problem, but the incorrect error
flag persists for the class.

Who can rid me of this turbulent error?

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Thanks Dmitry, excellent response as ever :)

0

There isn't really enough information in here to reproduce your bug.
Can you try reducing it down to a small testcase and filing a JIRA?

Who can rid me of this turbulent error?


Maybe with a JIRA you won't have to wait until 29 Dec.!
R

0

Dmitry Jemerov wrote:

This problem will be fixed in next 7.0.2 EAP.


Your new nick-name: "Reginald Fitzurse" :)
R
http://en.wikipedia.org/wiki/Thomas_Becket

0

OK, I'll try to reduce it to a test case, but I'm not overly optimistic as there are lots classes with similar hierarchies that don't show the problem...

Mind you, in this game, not being overly optimistic is probably a Good Thing ;)

0

Hello Dave,

Here's a simple example that shows the problem for me:

public class SomeServlet extends javax.servlet.http.HttpServlet implements
javax.servlet.Servlet

Up the path, all the methods are implemented, but IDEA still highlights the
class definition with red (class should be marked as abstract or implement
abstract method 'service (ServletRequest, ServletReponse)' in javax.servlet.GenericServlet).

I'm running with build 7531, BTW.

HTH,
Andrei


OK, I'll try to reduce it to a test case, but I'm not overly
optimistic as there are lots classes with similar hierarchies that
don't show the problem...

Mind you, in this game, not being overly optimistic is probably a Good
Thing ;)



0

OK, I was wrong about clashing method names (it's not all my code).

The problem class inherits from two hierarchies. The problem method is declared in interfaces in both hierarchies, but only implemented in one hierarchy.

IDEA thinks the problem class hasn't implemented the method from the hierarchy that doesn't implement it, although it has inherited an implementation of the method from the other hierarchy...

I'll file a JIRA...


Message was edited by:
Dave Lorde

0

Hello Dmitry,

Was that supposed to be 7549? I'm still seeing the problem with that build.

Best,
Andrei

Hello Dave,

>

This problem will be fixed in next 7.0.2 EAP.

>



Attachment(s):
AbstractError.png
0

Yup, thanks Andrei, that looks like the same thing - but too late, I already hacked out a minimal case!

0

Hello Dmitry,

This problem will be fixed in next 7.0.2 EAP.


I still see such an error in #7559.

Sascha

0

Hello Andrei,

Yes, the fix was supposed to be in 7549. We'll need to see if the fix was
integrated correctly...

Was that supposed to be 7549? I'm still seeing the problem with that
build.

Best,
Andrei

>> Hello Dave,
>>
>> This problem will be fixed in next 7.0.2 EAP.
>>
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

7559? Did I miss a build?

"Sascha Weinreuter" <sascha.weinreuter@NOSPAM-cit.de> wrote in message
news:fhaaoh$t6u$1@is.intellij.net...

Hello Dmitry,

>
>> This problem will be fixed in next 7.0.2 EAP.
>

I still see such an error in #7559.

>

Sascha



0

Brad L. wrote:

7559? Did I miss a build?


No, I meant 7549.

Sascha

0

Still seeing this problem in the new #7562... :(

N.

Dmitry Jemerov wrote:

Hello Andrei,

Yes, the fix was supposed to be in 7549. We'll need to see if the fix
was integrated correctly...

>> Was that supposed to be 7549? I'm still seeing the problem with that
>> build.
>>
>> Best,
>> Andrei
>>> Hello Dave,
>>>
>>> This problem will be fixed in next 7.0.2 EAP.
>>>

0

Could you please post the code example to the jira?

--
regards,
Alexey Kudravtsev
Software Developer
JetBrains, Inc, http://www.jetbrains.com
"Develop with pleasure!"

"Nathan Brown" <anecdotesoftware@gNmOaSiPl.cAoMm> wrote in message
news:fhsfo5$s4q$7@is.intellij.net...

Still seeing this problem in the new #7562... :(

>

N.

>

Dmitry Jemerov wrote:

>> Hello Andrei,
>>
>> Yes, the fix was supposed to be in 7549. We'll need to see if the fix was
>> integrated correctly...
>>
>>> Was that supposed to be 7549? I'm still seeing the problem with that
>>> build.
>>>
>>> Best,
>>> Andrei
>>>> Hello Dave,
>>>>
>>>> This problem will be fixed in next 7.0.2 EAP.
>>>>


0

Seems I am specifically only seeing it now for inner classes... does
this help?

N.

Alexey Kudravtsev (JetBrains) wrote:

Could you please post the code example to the jira?

0

Unfortunately no.
Could you please come up with small reproducible example?
--
regards,
Alexey Kudravtsev
Software Developer
JetBrains, Inc, http://www.jetbrains.com
"Develop with pleasure!"

"Nathan Brown" <anecdotesoftware@gNmOaSiPl.cAoMm> wrote in message
news:fhtaba$ker$1@is.intellij.net...

Seems I am specifically only seeing it now for inner classes... does this
help?

>

N.

>

Alexey Kudravtsev (JetBrains) wrote:

>> Could you please post the code example to the jira?
>>


0

OK, I'll try... what's the JIRA number for this?

Cheers,
N.

Alexey Kudravtsev (JetBrains) wrote:

Unfortunately no.
Could you please come up with small reproducible example?

0

http://www.jetbrains.net/jira/browse/IDEADEV-23176

--
regards,
Alexey Kudravtsev
Software Developer
JetBrains, Inc, http://www.jetbrains.com
"Develop with pleasure!"

"Nathan Brown" <anecdotesoftware@gNmOaSiPl.cAoMm> wrote in message
news:fhuh3s$drl$1@is.intellij.net...

OK, I'll try... what's the JIRA number for this?

>

Cheers,
N.

>

Alexey Kudravtsev (JetBrains) wrote:

>> Unfortunately no.
>> Could you please come up with small reproducible example?


0

Got it... test case attached to the JIRA item.

Cheers,
N.

Alexey Kudravtsev (JetBrains) wrote:

http://www.jetbrains.net/jira/browse/IDEADEV-23176

0

Sorry Alexey, this bug still exists in 7573 for anonymous inner classes.

N.

Nathan Brown wrote:

Got it... test case attached to the JIRA item.

Cheers,
N.

Alexey Kudravtsev (JetBrains) wrote:

>> http://www.jetbrains.net/jira/browse/IDEADEV-23176
>>

0

Please sign in to leave a comment.