The following code should fail to compile, but it compiles silently:
//JCK test innr005, bug #
class InheritHideBug {
static class S {
void m() { }
}
void m() { }
class C extends S {
{
m(); // BAD
}
}
}
The compiler in 1.1, 1.2, and 1.3 (as documented in the pre-generics whitepaper specification) featured the "Mother May I" rule, which requires the programmer to specify an explicit qualifier when an unqualified method name matches both an inherited and an outer method definition. This was dropped in 1.4 with the switch to a new javac code base. It is a recurrence of 4030368, and additionally the language specification also failed to include this rule (by design; see blogs.sun.com/jrose).
The ambiguity has been observed as a "Java puzzler" by Neal Gafter and Gilad Bracha. There is no need to keep this puzzler in the language. At least issue an obnoxious warning.