Change in javac handling of anonymous/local classes
Alex Buckley
alex.buckley at oracle.com
Wed Feb 27 16:01:18 PST 2013
On 2/27/2013 3:45 PM, John Rose wrote:
> The original draft of the inner classes spec. anticipated the comb rule
> and *excluded* it, as prone to error. (We decided that mixing
> inheritance and lexical scoping was a bad idea, at least for simple
> identifiers.)
>
> The then-editor of the JLS disagreed with that exclusion and refrained
> from incorporating it into the official spec.
So to unravel the double negatives: JLS Second Edition in 1999
incorporated the comb rule despite javac not implementing it until JDK
1.4 in 2002? (Your blog entry says javac prior to 1.4 implemented
Mother-May-I.) Astonishing.
I plan to add a note to JLS8 identifying the comb rule in 15.12.1, and
also an example based on John Spicer's code.
Alex
More information about the compiler-dev
mailing list