|
Re: Ganymede IHandler2/AbstractHandler execute() method not recognized in @Override [message #327874 is a reply to message #327872] |
Tue, 06 May 2008 23:25 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
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 13:37 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Beth Tibbitts![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=beth%40tibweb.com) Messages: 231 Registered: July 2009 |
Senior Member |
|
|
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 13:58 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Thomas Schindl![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=tom.schindl%40bestsolution.at) Messages: 6651 Registered: July 2009 |
Senior Member |
|
|
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 21:50 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Beth Tibbitts![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=beth%40tibweb.com) Messages: 231 Registered: July 2009 |
Senior Member |
|
|
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
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03972 seconds