Lines 129-152
Link Here
|
129 |
}, |
129 |
}, |
130 |
"" |
130 |
"" |
131 |
); |
131 |
); |
132 |
this.runNegativeTest( |
132 |
this.runConformTest( |
133 |
new String[] { |
133 |
new String[] { |
134 |
"X.java", |
134 |
"X.java", |
135 |
"import static p.A.C;\n" + |
135 |
"import static p.A.C;\n" + |
136 |
"public class X { int i = C; }\n", |
136 |
"public class X { \n" + |
|
|
137 |
" int i = C; \n" + |
138 |
" int j = p.A.C; \n" + |
139 |
"}\n", |
137 |
"p/A.java", |
140 |
"p/A.java", |
138 |
"package p;\n" + |
141 |
"package p;\n" + |
139 |
"public class A implements I {}\n" + |
142 |
"public class A implements I {}\n" + |
140 |
"interface I { public static int C = 1; }\n" |
143 |
"interface I { public static int C = 1; }\n" |
141 |
}, |
144 |
}, |
142 |
"----------\n" + |
145 |
""); |
143 |
"1. ERROR in X.java (at line 2)\n" + |
|
|
144 |
" public class X { int i = C; }\n" + |
145 |
" ^\n" + |
146 |
"The type I is not visible\n" + |
147 |
"----------\n" |
148 |
// C in p.I is not defined in a public class or interface; cannot be accessed from outside package |
149 |
); |
150 |
} |
146 |
} |
151 |
|
147 |
|
152 |
public void test004() { // test static vs. instance |
148 |
public void test004() { // test static vs. instance |
Lines 1341-1347
Link Here
|
1341 |
); |
1337 |
); |
1342 |
} |
1338 |
} |
1343 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=126564 |
1339 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=126564 |
1344 |
public void _test036() { |
1340 |
public void test036() { |
1345 |
this.runNegativeTest( |
1341 |
this.runNegativeTest( |
1346 |
new String[] { |
1342 |
new String[] { |
1347 |
"X.java", |
1343 |
"X.java", |
Lines 1360-1400
Link Here
|
1360 |
"class B { int CONSTANT_B = 1; }", |
1356 |
"class B { int CONSTANT_B = 1; }", |
1361 |
}, |
1357 |
}, |
1362 |
"----------\n" + |
1358 |
"----------\n" + |
1363 |
"1. ERROR in X.java (at line 1)\n" + |
1359 |
"1. ERROR in X.java (at line 2)\n" + |
1364 |
" import static p.A.CONSTANT_I;\n" + |
|
|
1365 |
" ^^^^^^^^^^^^^^\n" + |
1366 |
"The type I is not visible\n" + |
1367 |
"----------\n" + |
1368 |
"2. ERROR in X.java (at line 2)\n" + |
1369 |
" import static p.A.CONSTANT_B;\n" + |
1360 |
" import static p.A.CONSTANT_B;\n" + |
1370 |
" ^^^^^^^^^^^^^^\n" + |
1361 |
" ^^^^^^^^^^^^^^\n" + |
1371 |
"The type B is not visible\n" + |
1362 |
"The type B is not visible\n" + |
1372 |
"----------\n" + |
1363 |
"----------\n" + |
1373 |
"3. ERROR in X.java (at line 4)\n" + |
1364 |
"2. ERROR in X.java (at line 5)\n" + |
1374 |
" static int i = p.A.CONSTANT_I;\n" + |
|
|
1375 |
" ^^^^^^^^^^^^^^\n" + |
1376 |
"The type I is not visible\n" + |
1377 |
"----------\n" + |
1378 |
"4. ERROR in X.java (at line 5)\n" + |
1379 |
" static int j = p.A.CONSTANT_B;\n" + |
1365 |
" static int j = p.A.CONSTANT_B;\n" + |
1380 |
" ^^^^^^^^^^^^^^\n" + |
1366 |
" ^^^^^^^^^^^^^^\n" + |
1381 |
"The type B is not visible\n" + |
1367 |
"The type B is not visible\n" + |
1382 |
"----------\n" + |
1368 |
"----------\n" + |
1383 |
"5. ERROR in X.java (at line 6)\n" + |
1369 |
"3. ERROR in X.java (at line 7)\n" + |
1384 |
" static int m = CONSTANT_I;\n" + |
|
|
1385 |
" ^^^^^^^^^^\n" + |
1386 |
"CONSTANT_I cannot be resolved\n" + |
1387 |
"----------\n" + |
1388 |
"6. ERROR in X.java (at line 7)\n" + |
1389 |
" static int n = CONSTANT_B;\n" + |
1370 |
" static int n = CONSTANT_B;\n" + |
1390 |
" ^^^^^^^^^^\n" + |
1371 |
" ^^^^^^^^^^\n" + |
1391 |
"CONSTANT_B cannot be resolved\n" + |
1372 |
"CONSTANT_B cannot be resolved\n" + |
1392 |
"----------\n" |
1373 |
"----------\n"); |
1393 |
); |
|
|
1394 |
} |
1374 |
} |
1395 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=126564 - variation |
1375 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=126564 - variation |
1396 |
public void _test037() { |
1376 |
public void test037() { |
1397 |
this.runNegativeTest( |
1377 |
this.runConformTest( |
1398 |
new String[] { |
1378 |
new String[] { |
1399 |
"X.java", |
1379 |
"X.java", |
1400 |
"import static p.A.CONSTANT_I;\n" + |
1380 |
"import static p.A.CONSTANT_I;\n" + |
Lines 1411-1416
Link Here
|
1411 |
"interface I { int CONSTANT_I = 1; }\n" + |
1391 |
"interface I { int CONSTANT_I = 1; }\n" + |
1412 |
"class B { public static int CONSTANT_B = 1; }", |
1392 |
"class B { public static int CONSTANT_B = 1; }", |
1413 |
}, |
1393 |
}, |
1414 |
"?"); |
1394 |
""); |
1415 |
} |
1395 |
} |
1416 |
} |
1396 |
} |