override for interface question [message #248979] |
Fri, 19 October 2007 21:07  |
Eclipse User |
|
|
|
Originally posted by: tdelorenzi.verizon.net
I'm looking for a way to have eclipse help me find missing @Override
statements in front of functions that come exclusively from an interface.
According to this post:
http://dev.eclipse.org/newslists/news.eclipse.tools.jdt/msg2 1317.html
Cleanup does it, but I cannot reproduce that using the latest eclipse.
Either a way to make cleanup add them, or a way to make the compiler
complain if you don't have one like it does for overrides on super class
functions when you turn that option on.
If anyone has any ideas id be grateful. Thanks.
|
|
|
|
|
Re: override for interface question [message #248999 is a reply to message #248995] |
Mon, 22 October 2007 08:19   |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
This is a multi-part message in MIME format.
--------------070601000409070304060206
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Guys,
With Java 5.0 @Override is only allowed or required if you literally
override method in a base class. Only for Java 6.0 is @Override allowed
or required if you are only implementing an interface method. So the
behavior you get will depend on the source compatibility level you set
for your projects.
Nik Heger wrote:
> Err, sorry misunderstood your question - don't know how to do it exclusively
> for interfaces....
>
>
> On 10/20/07 8:07 AM, in article
> e69c7cacfaac803c9c2b47775922e9d5$1@www.eclipse.org, "Tom"
> <tdelorenzi@verizon.net> wrote:
>
>
>> I'm looking for a way to have eclipse help me find missing @Override
>> statements in front of functions that come exclusively from an interface.
>> According to this post:
>> http://dev.eclipse.org/newslists/news.eclipse.tools.jdt/msg2 1317.html
>> Cleanup does it, but I cannot reproduce that using the latest eclipse.
>>
>> Either a way to make cleanup add them, or a way to make the compiler
>> complain if you don't have one like it does for overrides on super class
>> functions when you turn that option on.
>>
>> If anyone has any ideas id be grateful. Thanks.
>>
>>
>
>
--------------070601000409070304060206
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Guys,<br>
<br>
With Java 5.0 @Override is only allowed or required if you literally
override method in a base class. Only for Java 6.0 is @Override
allowed or required if you are only implementing an interface method.
So the behavior you get will depend on the source compatibility level
you set for your projects.<br>
<br>
<br>
Nik Heger wrote:
<blockquote cite="mid:C3429E8A.5F8%25nheger@gmail.com" type="cite">
<pre wrap="">Err, sorry misunderstood your question - don't know how to do it exclusively
for interfaces....
On 10/20/07 8:07 AM, in article
<a class="moz-txt-link-abbreviated" href="mailto:e69c7cacfaac803c9c2b47775922e9d5$1@www.eclipse.org">e69c7cacfaac803c9c2b47775922e9d5$1@www.eclipse.org</a>, "Tom"
<a class="moz-txt-link-rfc2396E" href="mailto:tdelorenzi@verizon.net"><tdelorenzi@verizon.net></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">I'm looking for a way to have eclipse help me find missing @Override
statements in front of functions that come exclusively from an interface.
According to this post:
<a class="moz-txt-link-freetext" href=" http://dev.eclipse.org/newslists/news.eclipse.tools.jdt/msg2 1317.html"> http://dev.eclipse.org/newslists/news.eclipse.tools.jdt/msg2 1317.html</a>
Cleanup does it, but I cannot reproduce that using the latest eclipse.
Either a way to make cleanup add them, or a way to make the compiler
complain if you don't have one like it does for overrides on super class
functions when you turn that option on.
If anyone has any ideas id be grateful. Thanks.
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
<br>
</body>
</html>
--------------070601000409070304060206--
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05817 seconds