Lines 37-43
Link Here
|
37 |
} |
37 |
} |
38 |
|
38 |
|
39 |
static { |
39 |
static { |
40 |
// TESTS_NAMES = new String [] { "test096" }; |
40 |
TESTS_NAMES = new String [] { "test098" }; |
41 |
} |
41 |
} |
42 |
/** |
42 |
/** |
43 |
* Non-static member class |
43 |
* Non-static member class |
Lines 3176-3181
Link Here
|
3176 |
"The type B$A is not visible\n" + |
3176 |
"The type B$A is not visible\n" + |
3177 |
"----------\n"); |
3177 |
"----------\n"); |
3178 |
} |
3178 |
} |
|
|
3179 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=316956 |
3180 |
public void test098() { |
3181 |
this.runNegativeTest( |
3182 |
new String[] { |
3183 |
"A.java",//------------------------------ |
3184 |
"public class A {\n" + |
3185 |
" private int x;\n" + |
3186 |
" static class B {\n" + |
3187 |
" private int x;\n" + |
3188 |
" private C c = new C() {\n" + |
3189 |
" void foo() {\n" + |
3190 |
" x = 3;\n" + |
3191 |
" }\n" + |
3192 |
" };\n" + |
3193 |
" }\n" + |
3194 |
" static class C {\n" + |
3195 |
" private int x;\n" + |
3196 |
" }\n" + |
3197 |
" }\n", |
3198 |
}, |
3199 |
"----------\n" + |
3200 |
"1. WARNING in A.java (at line 2)\n" + |
3201 |
" private int x;\n" + |
3202 |
" ^\n" + |
3203 |
"The field A.x is never read locally\n" + |
3204 |
"----------\n" + |
3205 |
"2. ERROR in A.java (at line 7)\n" + |
3206 |
" x = 3;\n" + |
3207 |
" ^\n" + |
3208 |
"The field x is defined in an inherited type and an enclosing scope \n" + |
3209 |
"----------\n" + |
3210 |
"3. WARNING in A.java (at line 12)\n" + |
3211 |
" private int x;\n" + |
3212 |
" ^\n" + |
3213 |
"The field A.C.x is never read locally\n" + |
3214 |
"----------\n"); |
3215 |
} |
3179 |
public static Class testClass() { return LookupTest.class; |
3216 |
public static Class testClass() { return LookupTest.class; |
3180 |
} |
3217 |
} |
3181 |
} |
3218 |
} |