dev@glassfish.java.net

Re: Why does build fail with _at_Override? (trunk)

From: Lloyd Chambers <Lloyd.Chambers_at_Sun.COM>
Date: Thu, 23 Oct 2008 16:24:01 -0700

Kedar,

I think it's still unclear. We do override method signatures in our
interfaces (to provide annotations). So it seemed appropriate.

Lloyd

On Oct 23, 2008, at 4:21 PM, Kedar Mhaswade wrote:

>> I read the Javadoc for @Override and there is no indication it is
>> for only implementation. And I think it makes sense for sub-
>> interfaces; the same reasons apply (mis-spelling, verify that a
>> parent interface has the same signature, etc). In our case, we
>> have redundant (overridden) method for several things, not just
>> this case.
>
> Quoting Javadoc:
> "Indicates that a method declaration is intended to override a
> method declaration in a superclass. If a method is annotated with
> this annotation type but does not override a superclass method,
> compilers are required to generate an error message."
>
> I see "class" being stressed here. Of course, you can use it for
> interfaces, but
> I don't think it is the intent. You "override" implementation of a
> method in a
> subclass, not subinterface.