Community
Participate
Working Groups
Build 3.5M2 Follow-up of bug 128563 (comment 10) [...] Note that similar problem also exists with field access e.g. package1/A.java [ package package1; abstract class A { protected int outerField; { } } ] package1/B.java [ package package1; public class B extends A { } ] package2/C.java [ package package2; import package1.B; public class C extends B { private final MyInner myInner = new MyInner(); private class MyInner { public void innerMethod() { int j = C.this.outerField; } } public static void main(String[] args) { final C c = new C(); c.myInner.innerMethod(); } }
Added InnerEmulation#test157-160
Created attachment 113888 [details] Proposed patch
Added also InnerEmulationTest#test161-164 (for static fields)
Released for 3.5M3 Fixed
Previous change did break an existing situation like: class XSuper { protected String field; } public class X extends XSuper { protected String field; public static void main(String[] args) { new X().foo(); } void foo() { new Object() { void bar() { X.this.field = "[X#field]"; X.super.field = "[XSuper#field]"; System.out.print("X.this.field=" + X.this.field); System.out.print("X.super.field=" + X.super.field); } }.bar(); } } which should print: X.this.field=[X#field]X.super.field=[XSuper#field]
Added InnerEmulationTest#test166-168.
Created attachment 114016 [details] Extra patch
Did the extra patch get released ?
Not yet, there is still an issue with it... working on it.
Just released the extra patch, but still an issue for: public class X { class Member { private String field = "SUCCESS"; } class SubMember extends Member { void foo() { System.out.println(super.field); } } public static void main(String argv[]) { new X().new SubMember().foo(); } } (we didn't have a test for it) and similar replacing #field with a method: public class X { class Member { private String method() { return "SUCCESS";} } class SubMember extends Member { void foo() { System.out.println(super.method()); } } public static void main(String argv[]) { new X().new SubMember().foo(); } }
Added InnerEmulationTest#test170-171
Created attachment 114053 [details] More patch
Released last portion of the patch
All patches released for 3.5M3 Fixed
Verified for 3.5M3 using I20081026-2000 build.