What preference controls compile warning about @Override [message #247178] |
Fri, 31 August 2007 16:22  |
Eclipse User |
|
|
|
Originally posted by: eclipse5.rizzoweb.com
In my workspace, methods that have the @Override annotation but do not
actually override an inherited method produce a compiler error, The
method XXX must override a superclass method."
On coworkers' workspace this is not marked as an error. I've checked
that my preferences under Java > Compiler > Errors & Warnings >
Annotations are the same.
Any ideas what is making this an error instead of a warning or ignore?
Eric
|
|
|
|
|
|
|
Re: What preference controls compile warning about @Override [message #247530 is a reply to message #247416] |
Thu, 06 September 2007 09:31  |
Eclipse User |
|
|
|
Originally posted by: eclipse5.rizzoweb.com
Adam Giemza wrote:
> Olivier Thomann schrieb:
>> Ed Merks a écrit :
>>> Eric,
>>>
>>> Are you sure? I think an @Override that's not really an @Override
>>> must be treated as an error and there is no way to turn that off. Is
>>> it possible that the other guy is using Java 6.0 and you're using
>>> Java 5.0. I believe (but I'm not sure) that in 6.0 that @Override
>>> can also be used to indicate that you implement a method in an
>>> interface even when you don't actually override a method declaration
>>> in another class...
>> That is right. @Override in 1.6 is less restrictive than in 1.5.
>> --
>> Olivier
> Thanks for this hint. This is exactly the same problem, we had here. But
> I am running Eclipse with Java 1.6, but I use 1.5 for my projects. My
> compiler compliance level is also set to 5.0.
>
> Now if I set the cleanup properties to add missing "@Overrides", it adds
> the also to implemented interface methodes, that does not work with 1.5.
> Is it a bug or a feature?
You should enter a bug for that, since Java 5 projects will immediately
mark such annotations as an error. Clean-up should not produce compile
errors, obviously.
http://bugs.eclipse.org/bugs
Eric
|
|
|
Powered by
FUDForum. Page generated in 0.03374 seconds