Community
Participate
Working Groups
Build 20030129 The following code should be rejected by the compiler: ============= p/X.java package p; public abstract class X { abstract void foo(); } ============= q/Y.java abstract class Y extends X { void foo(){} } class Z extends Y {} ============= It should complain that Z should implement abstract (non-visible) method #foo(). Note that the compiler already diagnosed that Y.foo() did not override X.foo() (warning).
Fixed, method verifier got fooled by intermediate method presence (did not bother looking at X.foo() abstract method any longer.
I'm confused as to why this test case should be rejected. It looks completely valid to me.
Since Y.foo() doesn't override default X.foo() as it cannot see it. It should be equivalent to a scenario where Y did not define any #foo() at all.
I must be dislexic. Now I see that 'p' and 'q' are different. Thanks.
No problem, actually my test case q\Y.java is missing the package declaration too...
Verified.