### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core.tests.compiler Index: src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java,v retrieving revision 1.46 diff -u -r1.46 InnerEmulationTest.java --- src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java 1 Oct 2008 21:15:39 -0000 1.46 +++ src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java 1 Oct 2008 22:25:37 -0000 @@ -6965,6 +6965,46 @@ }, "X.this.method()=[X#method()]X.super.method()=[XInternal#method()]"); } +//https://bugs.eclipse.org/bugs/show_bug.cgi?id=249107 - variation +public void test170() throws Exception { + this.runConformTest(new String[] { + "X.java",//======================= + "public class X {\n" + + " class Member {\n" + + " private String field = \"SUCCESS\";\n" + + " }\n" + + " class SubMember extends Member {\n" + + " void foo() {\n" + + " System.out.println(super.field);\n" + + " }\n" + + " } \n" + + " public static void main(String argv[]) {\n" + + " new X().new SubMember().foo(); \n" + + " }\n" + + "}\n", + }, + "SUCCESS"); +} +//https://bugs.eclipse.org/bugs/show_bug.cgi?id=249107 - variation +public void test171() throws Exception { + this.runConformTest(new String[] { + "X.java",//======================= + "public class X {\n" + + " class Member {\n" + + " private String method() { return \"SUCCESS\"; }\n" + + " }\n" + + " class SubMember extends Member {\n" + + " void foo() {\n" + + " System.out.println(super.method());\n" + + " }\n" + + " } \n" + + " public static void main(String argv[]) {\n" + + " new X().new SubMember().foo(); \n" + + " }\n" + + "}\n", + }, + "SUCCESS"); +} public static Class testClass() { return InnerEmulationTest.class; } #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java,v retrieving revision 1.123 diff -u -r1.123 FieldReference.java --- compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java 1 Oct 2008 21:16:38 -0000 1.123 +++ compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java 1 Oct 2008 22:25:42 -0000 @@ -419,15 +419,13 @@ if (this.syntheticAccessors == null) this.syntheticAccessors = new MethodBinding[2]; this.syntheticAccessors[isReadAccess ? FieldReference.READ : FieldReference.WRITE] = - ((SourceTypeBinding) codegenBinding.declaringClass).addSyntheticMethod(codegenBinding, isReadAccess, isSuperAccess()); + ((SourceTypeBinding) codegenBinding.declaringClass).addSyntheticMethod(codegenBinding, isReadAccess, false /* not super ref in remote type*/); currentScope.problemReporter().needToEmulateFieldAccess(codegenBinding, this, isReadAccess); return; } } else if (this.receiver instanceof QualifiedSuperReference) { // qualified super // qualified super need emulation always - SourceTypeBinding destinationType = - (SourceTypeBinding) (((QualifiedSuperReference) this.receiver) - .currentCompatibleType); + SourceTypeBinding destinationType = (SourceTypeBinding) (((QualifiedSuperReference) this.receiver).currentCompatibleType); if (this.syntheticAccessors == null) this.syntheticAccessors = new MethodBinding[2]; this.syntheticAccessors[isReadAccess ? FieldReference.READ : FieldReference.WRITE] = destinationType.addSyntheticMethod(codegenBinding, isReadAccess, isSuperAccess()); Index: compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java,v retrieving revision 1.136 diff -u -r1.136 MessageSend.java --- compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java 30 Sep 2008 15:31:25 -0000 1.136 +++ compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java 1 Oct 2008 22:25:43 -0000 @@ -207,8 +207,7 @@ // depth is set for both implicit and explicit access (see MethodBinding#canBeSeenBy) if (currentScope.enclosingSourceType() != codegenBinding.declaringClass){ - - this.syntheticAccessor = ((SourceTypeBinding)codegenBinding.declaringClass).addSyntheticMethod(codegenBinding, isSuperAccess()); + this.syntheticAccessor = ((SourceTypeBinding)codegenBinding.declaringClass).addSyntheticMethod(codegenBinding, false /* not super access there */); currentScope.problemReporter().needToEmulateMethodAccess(codegenBinding, this); return; }