Change in javac handling of anonymous/local classes
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Wed Feb 27 13:40:13 PST 2013
On 27/02/13 21:16, Alex Buckley wrote:
> - I suspect javac 1.6 and 1.7 choose TT.f3(String) because of a
> different belief about shadowing. Maurizio, please comment on what's
> visible at 'f3(0);'.
Javac implements the so called comb-lookup [1] - supertypes are looked
up before enclosing types. The problem with f1 is a glitch that has been
fixed in JDK 8.
Afaik the comb rule is also supported in Eclipse. I don't think there's
any compiler out there that think the anonymous class has two f3 members.
[1] -
https://blogs.oracle.com/jrose/entry/scope_ambiguities_between_outer_and
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20130227/e6bf80f4/attachment.html
More information about the compiler-dev
mailing list