Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!peer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!fx25.iad.POSTED!not-for-mail From: Wayne User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: Use of @Override when implementing interfaces References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Lines: 26 Message-ID: X-Complaints-To: abuse@newshosting.com NNTP-Posting-Date: Sat, 07 Dec 2013 09:46:22 UTC Organization: Newshosting.com - Highest quality at a great price! www.newshosting.com Date: Sat, 07 Dec 2013 04:46:42 -0500 X-Received-Bytes: 1781 X-Received-Body-CRC: 2538739798 Xref: csiph.com comp.lang.java.programmer:26759 On 12/7/2013 2:14 AM, Volker Borchert wrote: > Fredrik Jonson wrote: > >> Is it commont practice to use @Override when implementing interface >> methods? Assuming that the method has not been implemented by a >> superclass. > > It helps reading the code of classes that have many methods, maybe > some of them with similar sounding names, but only fsw implementing > some not so well-known interface. > > For that reason, I'd even like @Override to allow a value indicating > the class or interface where the overridden method lives. For now, > I'm (ab-)using @see javadoc for this purpose, but that isn't part of > the method's signature and therefore doesn't show up as prominently > in IDEs' code completion suggestions etc. > Instead of that, why not create your own annotation, something like: @From("MyInterface") @Override public void someMethod () { ... } -- Wayne