Community
Participate
Working Groups
Given: public class E01 { public static class Foo { private Object model; protected void foo() { } } private static class Outer { private Object model; private static class Inner { private Object model; public void bar() { new Foo() { @Override protected void foo() { System.out.println(model); } }; } } } } This code compiles fine in I20101208-1300 whereas in M20100909-0800 I get a compile error: "The field model is defined in an inherited type and an enclosing scope" I've tested with a blank workspace in both version, compiler compliance is 1.6 in both workspaces. I assume 3.6.1 is wrong and that this is a fix in 3.7. But I could not find the corresponding bug report. So I though I better report it in case it is a regression...
Thanks for reporting this. No, this is not a regression and the behavior on 3.7 branch is the correct one and is the outcome of the fix for bug 316956 and also matches javac 5,6.7. This fix was released for 3.7 M1 and was not back ported to 3.6 maintenance stream as this was not a regression relative to 3.5. (Behavior was same going backwards at least until 3.3.2, probably forever)
Verified for 3.7M5 using I20110124-1800