> On Mon, Nov 28, 2011 at 6:03 AM, Uwe Schindler <[email protected]> wrote:
> >> > The slight change is the last word. An interface is a more general
> "supertype"
> >> but definitely no "superclass".
> >> >
> >>
> >> Sure it is, its a superclass with only pure virtual methods :)
> >
> > No, see Java Language Specification 3rd edition:
> > http://java.sun.com/docs/books/jls/third_edition/html/classes.html
> >
> 
> Thats just fancy wording around the reality. Of course these are classes, 
> thats
> why you can do Class.forName("java.io.Closeable") and why you can do
> java.io.Closeable.class !

You mix "specification" with "implementation details". The specification and 
javadocs are authoritative.

I just conclude:
- Java 5 is correct in complaining about "@Override" on interfaces. It does not 
override a method in a super*class* (and the message explicitely states this).
- Java 6 modifies the behavior from "superclass" to "supertype" so @Override on 
interfaces work, but has 2 bugs (documentation bug [fixed in java 7] and a bug 
in javac that with -source 1.5 it does not mimic Java5's javac correctly - and 
that’s our real problem).
- Java 7 fixes documentation, but compiler with -source 1.5 still broken

I general I refuse to add @Override to interface impls as it does not (as Dawid 
notes) make sense from the logical perspective. I would prefer @Implements 
(also for abstract methods).
I don’t use shitty Eclipse that adds @Override to interfaces, I have the power 
to decide myself and I do it, I don’t add @Override for interfaces, even for 
Java 6 sourcecode.

Uwe


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to