Bug 332841

Summary: The field is defined in an inherited type and an enclosing scope compile error in 3.6.1 but not in 3.7
Product: [Eclipse Project] JDT Reporter: Benno Baumgartner <benno.baumgartner>
Component: CoreAssignee: Srikanth Sankaran <srikanth_sankaran>
Status: VERIFIED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: Olivier_Thomann
Version: 3.7   
Target Milestone: 3.7 M4   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Benno Baumgartner CLA 2010-12-17 07:56:58 EST
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...
Comment 1 Srikanth Sankaran CLA 2010-12-17 20:46:59 EST
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)
Comment 2 Olivier Thomann CLA 2011-01-25 09:33:47 EST
Verified for 3.7M5 using I20110124-1800