-
Bug
-
Resolution: Fixed
-
P5
-
6
-
None
-
rc
-
generic
-
generic
-
Verified
The formal definition of "overrides" in 8.4.8 does not
depend on the "abstract" modifier. Abstract comes into play only in that:
Moreover, if m1 is not abstract, then m1 is said to *implement* any and
all declarations of abstract methods that it overrides.
However, there's a less formal description of "overrides" in 6.4.3
that says:
If the method not inherited is abstract, then the new declaration is
said to *implement* it; if the method not inherited is not abstract,
then the new declaration is said to *override* it.
The submitter of 6409362 took the latter section at
face value and incorrectly concluded that "implements" and "overrides"
are mutually exclusive.
While discussing this with Peter we noted that:
Section 8.4.8.1 describes overriding when one class extends another
class, and section 9.4.1 describes overriding when one interface
extends another interface. We could not find a similarly-rigorous
description covering the case of a class implementing an interface:
interface I { void m(); }
class C implements I { public void m() {}; }
The first paragraph of 8.4.8 does, however, seem to imply that 8.4.8.1
should be applicable, and that since I.m is not inherited by C
(it's not, right?), it must be due to I.m being overridden by C.m.
depend on the "abstract" modifier. Abstract comes into play only in that:
Moreover, if m1 is not abstract, then m1 is said to *implement* any and
all declarations of abstract methods that it overrides.
However, there's a less formal description of "overrides" in 6.4.3
that says:
If the method not inherited is abstract, then the new declaration is
said to *implement* it; if the method not inherited is not abstract,
then the new declaration is said to *override* it.
The submitter of 6409362 took the latter section at
face value and incorrectly concluded that "implements" and "overrides"
are mutually exclusive.
While discussing this with Peter we noted that:
Section 8.4.8.1 describes overriding when one class extends another
class, and section 9.4.1 describes overriding when one interface
extends another interface. We could not find a similarly-rigorous
description covering the case of a class implementing an interface:
interface I { void m(); }
class C implements I { public void m() {}; }
The first paragraph of 8.4.8 does, however, seem to imply that 8.4.8.1
should be applicable, and that since I.m is not inherited by C
(it's not, right?), it must be due to I.m being overridden by C.m.
- relates to
-
JDK-6409362 A non-abstract method does not override an abstract one
- Closed
-
JDK-6500703 Java needs Implement annotation and change of definition of "override"
- Closed
-
JDK-6399361 CONFORMANCE: @Override specification and compiler inconsistent
- Closed