### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core.tests.compiler Index: src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java,v retrieving revision 1.84 diff -u -r1.84 LookupTest.java --- src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java 23 Jun 2010 06:52:41 -0000 1.84 +++ src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java 25 Jun 2010 03:48:50 -0000 @@ -37,7 +37,7 @@ } static { -// TESTS_NAMES = new String [] { "test096" }; + TESTS_NAMES = new String [] { "test098" }; } /** * Non-static member class @@ -3176,6 +3176,43 @@ "The type B$A is not visible\n" + "----------\n"); } +// https://bugs.eclipse.org/bugs/show_bug.cgi?id=316956 +public void test098() { + this.runNegativeTest( + new String[] { + "A.java",//------------------------------ + "public class A {\n" + + " private int x;\n" + + " static class B {\n" + + " private int x;\n" + + " private C c = new C() {\n" + + " void foo() {\n" + + " x = 3;\n" + + " }\n" + + " };\n" + + " }\n" + + " static class C {\n" + + " private int x;\n" + + " }\n" + + " }\n", + }, + "----------\n" + + "1. WARNING in A.java (at line 2)\n" + + " private int x;\n" + + " ^\n" + + "The field A.x is never read locally\n" + + "----------\n" + + "2. ERROR in A.java (at line 7)\n" + + " x = 3;\n" + + " ^\n" + + "The field x is defined in an inherited type and an enclosing scope \n" + + "----------\n" + + "3. WARNING in A.java (at line 12)\n" + + " private int x;\n" + + " ^\n" + + "The field A.C.x is never read locally\n" + + "----------\n"); +} public static Class testClass() { return LookupTest.class; } }