@Override annotation @ run() method
Posted: Tue Jun 28, 2011 5:51 pm
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 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..