Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Ganymede IHandler2/AbstractHandler execute() method not recognized in @Override
Ganymede IHandler2/AbstractHandler execute() method not recognized in @Override [message #327872] Tue, 06 May 2008 18:53 Go to next message
Eclipse UserFriend
I'm trying to convert some 3.3 code to Ganymede/3.4

I have a class (AnalysisDropdownHandler) that extends
org.eclipse.core.commands.AbstractHandler, which in 3.3 implements IHandler.

In 3.4, AbstractHandler instead implements IHandler2, which extends
IHandler.

My class has an @Override annotation on its execute() method:
@Override
public Object execute(ExecutionEvent event) throws
ExecutionException { ...}

execute() is (still) in the IHandler interface.

So, why does the compiler give me an error on my code?

If I hover over the error I get:
Multiple markers at this line
- implements org.eclipse.core.commands.IHandler.execute
- The method execute(ExecutionEvent) of type
AnalysisDropdownHandler must override a superclass method

Am I missing something obvious?


....Beth Tibbitts
Re: Ganymede IHandler2/AbstractHandler execute() method not recognized in @Override [message #327874 is a reply to message #327872] Tue, 06 May 2008 19:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Beth,

@Override has different meaning in Java 5.0 verses Java 6.0. What
source compatibility setting are you using when compiling? For Java
5.0, @Override must override a base class' implementation but for Java
6.0, it's sufficient that the method implement a declared interface
method (more like @Implements) rather than literally an override of a
base class method.


Beth Tibbitts wrote:
> I'm trying to convert some 3.3 code to Ganymede/3.4
>
> I have a class (AnalysisDropdownHandler) that extends
> org.eclipse.core.commands.AbstractHandler, which in 3.3 implements
> IHandler.
>
> In 3.4, AbstractHandler instead implements IHandler2, which extends
> IHandler.
>
> My class has an @Override annotation on its execute() method:
> @Override
> public Object execute(ExecutionEvent event) throws
> ExecutionException { ...}
>
> execute() is (still) in the IHandler interface.
>
> So, why does the compiler give me an error on my code?
>
> If I hover over the error I get:
> Multiple markers at this line
> - implements org.eclipse.core.commands.IHandler.execute
> - The method execute(ExecutionEvent) of type
> AnalysisDropdownHandler must override a superclass method
>
> Am I missing something obvious?
>
>
> ...Beth Tibbitts
Re: Ganymede IHandler2/AbstractHandler execute() method not recognized in @Override [message #327887 is a reply to message #327874] Wed, 07 May 2008 09:37 Go to previous messageGo to next message
Eclipse UserFriend
Thanks, Ed.
I'm using the default compatibility settings (I think) in both Eclipse
3.3 and 3.4.
In 3.4 preferences, Java > Compiler is set to use default compliance
settings, which is 1.5.

In 3.3 it's set to default compliance setting, which is 5.0 (Funny that
they would change the terminology)

The only way i see to get around this is to remove the @Overrides
annotation??? That doesn't seem right. If the execute() method had
truly gone away in the underlying class/interfaces, it would have been
crucial to point me to that error. In my case it doesn't seem to be an
error.

....Beth

Ed Merks wrote:
> Beth,
>
> @Override has different meaning in Java 5.0 verses Java 6.0. What
> source compatibility setting are you using when compiling? For Java
> 5.0, @Override must override a base class' implementation but for Java
> 6.0, it's sufficient that the method implement a declared interface
> method (more like @Implements) rather than literally an override of a
> base class method.
>
>
> Beth Tibbitts wrote:
>> I'm trying to convert some 3.3 code to Ganymede/3.4
>>
>> I have a class (AnalysisDropdownHandler) that extends
>> org.eclipse.core.commands.AbstractHandler, which in 3.3 implements
>> IHandler.
>>
>> In 3.4, AbstractHandler instead implements IHandler2, which extends
>> IHandler.
>>
>> My class has an @Override annotation on its execute() method:
>> @Override
>> public Object execute(ExecutionEvent event) throws
>> ExecutionException { ...}
>>
>> execute() is (still) in the IHandler interface.
>>
>> So, why does the compiler give me an error on my code?
>>
>> If I hover over the error I get:
>> Multiple markers at this line
>> - implements org.eclipse.core.commands.IHandler.execute
>> - The method execute(ExecutionEvent) of type
>> AnalysisDropdownHandler must override a superclass method
>>
>> Am I missing something obvious?
>>
>>
>> ...Beth Tibbitts
Re: Ganymede IHandler2/AbstractHandler execute() method not recognized in @Override [message #327891 is a reply to message #327887] Wed, 07 May 2008 09:58 Go to previous messageGo to next message
Eclipse UserFriend
The explanation is in https://bugs.eclipse.org/bugs/show_bug.cgi?id=230063

In fact this was a bug in Eclipse 3.3 there's never been a method in the
AbstractHandler and Eclipse wrongly reported it and hence added an
@Override :-)

Tom

Beth Tibbitts schrieb:
> Thanks, Ed.
> I'm using the default compatibility settings (I think) in both Eclipse
> 3.3 and 3.4.
> In 3.4 preferences, Java > Compiler is set to use default compliance
> settings, which is 1.5.
>
> In 3.3 it's set to default compliance setting, which is 5.0 (Funny that
> they would change the terminology)
>
> The only way i see to get around this is to remove the @Overrides
> annotation??? That doesn't seem right. If the execute() method had
> truly gone away in the underlying class/interfaces, it would have been
> crucial to point me to that error. In my case it doesn't seem to be an
> error.
>
> ...Beth
>
> Ed Merks wrote:
>> Beth,
>>
>> @Override has different meaning in Java 5.0 verses Java 6.0. What
>> source compatibility setting are you using when compiling? For Java
>> 5.0, @Override must override a base class' implementation but for Java
>> 6.0, it's sufficient that the method implement a declared interface
>> method (more like @Implements) rather than literally an override of a
>> base class method.
>>
>>
>> Beth Tibbitts wrote:
>>> I'm trying to convert some 3.3 code to Ganymede/3.4
>>>
>>> I have a class (AnalysisDropdownHandler) that extends
>>> org.eclipse.core.commands.AbstractHandler, which in 3.3 implements
>>> IHandler.
>>>
>>> In 3.4, AbstractHandler instead implements IHandler2, which extends
>>> IHandler.
>>>
>>> My class has an @Override annotation on its execute() method:
>>> @Override
>>> public Object execute(ExecutionEvent event) throws
>>> ExecutionException { ...}
>>>
>>> execute() is (still) in the IHandler interface.
>>>
>>> So, why does the compiler give me an error on my code?
>>>
>>> If I hover over the error I get:
>>> Multiple markers at this line
>>> - implements org.eclipse.core.commands.IHandler.execute
>>> - The method execute(ExecutionEvent) of type
>>> AnalysisDropdownHandler must override a superclass method
>>>
>>> Am I missing something obvious?
>>>
>>>
>>> ...Beth Tibbitts


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: Ganymede IHandler2/AbstractHandler execute() method not recognized in @Override [message #327900 is a reply to message #327891] Wed, 07 May 2008 17:50 Go to previous message
Eclipse UserFriend
Thanks Tom.
I've removed the @Override annotation and things work fine.
....Beth

Tom Schindl wrote:
> The explanation is in https://bugs.eclipse.org/bugs/show_bug.cgi?id=230063
>
> In fact this was a bug in Eclipse 3.3 there's never been a method in the
> AbstractHandler and Eclipse wrongly reported it and hence added an
> @Override :-)
>
> Tom
>
> Beth Tibbitts schrieb:
>> Thanks, Ed.
>> I'm using the default compatibility settings (I think) in both Eclipse
>> 3.3 and 3.4.
>> In 3.4 preferences, Java > Compiler is set to use default compliance
>> settings, which is 1.5.
>>
>> In 3.3 it's set to default compliance setting, which is 5.0 (Funny
>> that they would change the terminology)
>>
>> The only way i see to get around this is to remove the @Overrides
>> annotation??? That doesn't seem right. If the execute() method had
>> truly gone away in the underlying class/interfaces, it would have been
>> crucial to point me to that error. In my case it doesn't seem to be
>> an error.
>>
>> ...Beth
>>
>> Ed Merks wrote:
>>> Beth,
>>>
>>> @Override has different meaning in Java 5.0 verses Java 6.0. What
>>> source compatibility setting are you using when compiling? For Java
>>> 5.0, @Override must override a base class' implementation but for
>>> Java 6.0, it's sufficient that the method implement a declared
>>> interface method (more like @Implements) rather than literally an
>>> override of a base class method.
>>>
>>>
>>> Beth Tibbitts wrote:
>>>> I'm trying to convert some 3.3 code to Ganymede/3.4
>>>>
>>>> I have a class (AnalysisDropdownHandler) that extends
>>>> org.eclipse.core.commands.AbstractHandler, which in 3.3 implements
>>>> IHandler.
>>>>
>>>> In 3.4, AbstractHandler instead implements IHandler2, which extends
>>>> IHandler.
>>>>
>>>> My class has an @Override annotation on its execute() method:
>>>> @Override
>>>> public Object execute(ExecutionEvent event) throws
>>>> ExecutionException { ...}
>>>>
>>>> execute() is (still) in the IHandler interface.
>>>>
>>>> So, why does the compiler give me an error on my code?
>>>>
>>>> If I hover over the error I get:
>>>> Multiple markers at this line
>>>> - implements org.eclipse.core.commands.IHandler.execute
>>>> - The method execute(ExecutionEvent) of type
>>>> AnalysisDropdownHandler must override a superclass method
>>>>
>>>> Am I missing something obvious?
>>>>
>>>>
>>>> ...Beth Tibbitts
>
>
Previous Topic:Running ant task within Eclipse
Next Topic:eclipse 3.4M6 won't run from NFS disk
Goto Forum:
  


Current Time: Wed Apr 30 15:11:52 EDT 2025

Powered by FUDForum. Page generated in 0.06644 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top