@Override annotation @ run() method

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
Starter
Posts: 484
Joined: Sat Jan 23, 2010 4:42 pm

@Override annotation @ run() method

Post by Starter »

Hey guys,

I got a general question why its more and more the case that the @Override annotation is more and more used at the run() method.

At first I thought that its better to do this and since its a new feature to do this it can only be good but I found out that its kinda useless at the end especially to add this annotation on interface implementation since its inconsistent since there is no such thing as "overriding an interface" in java / interface implementation is useless since in practise it catches no bugs that the compilation wouldn't catch anyway. There is only one, far fetched scenario where override on implementers actually does something: If you implement an interface, and the interface REMOVES methods, you will be notified on compile time that you should remove the unused implementations. Notice that if the new version of the interface has NEW or CHANGED methods you'll obviously get a compile error anyways as you're not implementing the new stuff.

So why its done? Only because one or several devs have that feature in their IDE enabled? Its more "code" for nothing at the end..
I have promises to keep and miles to go before I sleep.
User avatar
Stake
Posts: 383
Joined: Sun Mar 23, 2008 9:33 pm
Location: Hungary
Contact:

Re: @Override annotation @ run() method

Post by Stake »

Yes, first it's needed for IDE, second, interface polymorphism is just the same like any other. Every method overrides the interface's virtual "null" or "abstract" methods. So basically this is an override.
Image
Image
User avatar
JIV
L2j Veteran
L2j Veteran
Posts: 1882
Joined: Sun Jan 06, 2008 8:17 pm
Location: Slovakia
Contact:

Re: @Override annotation @ run() method

Post by JIV »

i dont share this new attitude putting over interface implementation method @Override annotation, its just totally useless and misleading. I think it just should be some other annotation, not same.
Post Reply