Lines 27-34
Link Here
|
27 |
|
27 |
|
28 |
static { |
28 |
static { |
29 |
// TESTS_NAMES = new String[] { "test000" }; |
29 |
// TESTS_NAMES = new String[] { "test000" }; |
30 |
// TESTS_NUMBERS = new int[] { 27 }; |
30 |
// TESTS_NUMBERS = new int[] { 1 }; |
31 |
// TESTS_RANGE = new int[] { 11, -1 }; |
31 |
// TESTS_RANGE = new int[] { 1, -1 }; |
32 |
} |
32 |
} |
33 |
public BatchCompilerTest(String name) { |
33 |
public BatchCompilerTest(String name) { |
34 |
super(name); |
34 |
super(name); |
Lines 1537-1549
Link Here
|
1537 |
" (at line 5)\n" + |
1537 |
" (at line 5)\n" + |
1538 |
" Warn warn;\n" + |
1538 |
" Warn warn;\n" + |
1539 |
" ^^^^\n" + |
1539 |
" ^^^^\n" + |
1540 |
"Discouraged access: Warn\n" + |
1540 |
"Discouraged access: The type Warn is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---/p1\n" + |
1541 |
"----------\n" + |
1541 |
"----------\n" + |
1542 |
"2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java\n" + |
1542 |
"2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java\n" + |
1543 |
" (at line 6)\n" + |
1543 |
" (at line 6)\n" + |
1544 |
" KO ko;\n" + |
1544 |
" KO ko;\n" + |
1545 |
" ^^\n" + |
1545 |
" ^^\n" + |
1546 |
"Access restriction: KO\n" + |
1546 |
"Access restriction: The type KO is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---\n" + |
1547 |
"----------\n" + |
1547 |
"----------\n" + |
1548 |
"3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java\n" + |
1548 |
"3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java\n" + |
1549 |
" (at line 7)\n" + |
1549 |
" (at line 7)\n" + |
Lines 2108-2114
Link Here
|
2108 |
" (at line 2)\n" + |
2108 |
" (at line 2)\n" + |
2109 |
" public class Y extends p.X {\n" + |
2109 |
" public class Y extends p.X {\n" + |
2110 |
" ^^^\n" + |
2110 |
" ^^^\n" + |
2111 |
"Discouraged access: X\n" + |
2111 |
"Discouraged access: The type X is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---/bin1\n" + |
2112 |
"----------\n" + |
2112 |
"----------\n" + |
2113 |
"1 problem (1 warning)", |
2113 |
"1 problem (1 warning)", |
2114 |
false); |
2114 |
false); |
Lines 2189-2218
Link Here
|
2189 |
" (at line 3)\n" + |
2189 |
" (at line 3)\n" + |
2190 |
" X x1;\n" + |
2190 |
" X x1;\n" + |
2191 |
" ^\n" + |
2191 |
" ^\n" + |
2192 |
"Discouraged access: X<T>\n" + |
2192 |
"Discouraged access: The type X<T> is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---/bin1\n" + |
2193 |
"----------\n" + |
2193 |
"----------\n" + |
2194 |
"2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java\n" + |
2194 |
"2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java\n" + |
2195 |
" (at line 4)\n" + |
2195 |
" (at line 4)\n" + |
2196 |
" X<String> x2 = new X<String>();\n" + |
2196 |
" X<String> x2 = new X<String>();\n" + |
2197 |
" ^\n" + |
2197 |
" ^\n" + |
2198 |
"Discouraged access: X<String>\n" + |
2198 |
"Discouraged access: The type X<String> is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---/bin1\n" + |
2199 |
"----------\n" + |
2199 |
"----------\n" + |
2200 |
"3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java\n" + |
2200 |
"3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java\n" + |
2201 |
" (at line 4)\n" + |
2201 |
" (at line 4)\n" + |
2202 |
" X<String> x2 = new X<String>();\n" + |
2202 |
" X<String> x2 = new X<String>();\n" + |
2203 |
" ^^^^^^^^^^^^^^^\n" + |
2203 |
" ^^^^^^^^^^^^^^^\n" + |
2204 |
"Discouraged access: X<String>()\n" + |
2204 |
"Discouraged access: The constructor X<String>() is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---/bin1\n" + |
2205 |
"----------\n" + |
2205 |
"----------\n" + |
2206 |
"4. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java\n" + |
2206 |
"4. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java\n" + |
2207 |
" (at line 4)\n" + |
2207 |
" (at line 4)\n" + |
2208 |
" X<String> x2 = new X<String>();\n" + |
2208 |
" X<String> x2 = new X<String>();\n" + |
2209 |
" ^\n" + |
2209 |
" ^\n" + |
2210 |
"Discouraged access: X<String>\n" + |
2210 |
"Discouraged access: The type X<String> is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---/bin1\n" + |
2211 |
"----------\n" + |
2211 |
"----------\n" + |
2212 |
"4 problems (4 warnings)", |
2212 |
"4 problems (4 warnings)", |
2213 |
false); |
2213 |
false); |
2214 |
} |
2214 |
} |
2215 |
|
2215 |
|
|
|
2216 |
// check we get appropriate combination of access rules |
2217 |
public void test040(){ |
2218 |
this.runConformTest( |
2219 |
new String[] { |
2220 |
"p/X.java", |
2221 |
"package p;\n" + |
2222 |
"/** */\n" + |
2223 |
"public class X {\n" + |
2224 |
"}", |
2225 |
"p/Z.java", |
2226 |
"package p;\n" + |
2227 |
"/** */\n" + |
2228 |
"public class Z {\n" + |
2229 |
"}" |
2230 |
}, |
2231 |
"\"" + OUTPUT_DIR + File.separator + "p" + File.separator + "X.java\"" |
2232 |
+ " \"" + OUTPUT_DIR + File.separator + "p" + File.separator + "Z.java\"" |
2233 |
+ " -1.5 -g -preserveAllLocals" |
2234 |
+ " -nowarn" |
2235 |
+ " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"", |
2236 |
"", |
2237 |
"", |
2238 |
true); |
2239 |
this.runConformTest( |
2240 |
new String[] { |
2241 |
"Y.java", |
2242 |
"/** */\n" + |
2243 |
"public class Y {\n" + |
2244 |
" p.X x;\n" + |
2245 |
" p.Z z;\n" + |
2246 |
"}", |
2247 |
}, |
2248 |
"\"" + OUTPUT_DIR + File.separator + "Y.java\"" |
2249 |
+ " -1.5 -g -preserveAllLocals" |
2250 |
+ " -cp \"" + OUTPUT_DIR + "[+p/X" + File.pathSeparator + "-p/*]\"" |
2251 |
+ " -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" |
2252 |
+ " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"", |
2253 |
"", |
2254 |
"----------\n" + |
2255 |
"1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/Y.java\n" + |
2256 |
" (at line 4)\n" + |
2257 |
" p.Z z;\n" + |
2258 |
" ^^^\n" + |
2259 |
"Access restriction: The type Z is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---\n" + |
2260 |
"----------\n" + |
2261 |
"1 problem (1 warning)", |
2262 |
false); |
2263 |
} |
2264 |
|
2265 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=124533 |
2266 |
// turn off discouraged references warnings |
2267 |
public void test041(){ |
2268 |
this.runConformTest( |
2269 |
new String[] { |
2270 |
"p/X.java", |
2271 |
"package p;\n" + |
2272 |
"/** */\n" + |
2273 |
"public class X {\n" + |
2274 |
"}", |
2275 |
"p/Z.java", |
2276 |
"package p;\n" + |
2277 |
"/** */\n" + |
2278 |
"public class Z {\n" + |
2279 |
"}" |
2280 |
}, |
2281 |
"\"" + OUTPUT_DIR + File.separator + "p" + File.separator + "X.java\"" |
2282 |
+ " \"" + OUTPUT_DIR + File.separator + "p" + File.separator + "Z.java\"" |
2283 |
+ " -1.5 -g -preserveAllLocals" |
2284 |
+ " -nowarn" |
2285 |
+ " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"", |
2286 |
"", |
2287 |
"", |
2288 |
true); |
2289 |
this.runConformTest( |
2290 |
new String[] { |
2291 |
"Y.java", |
2292 |
"/** */\n" + |
2293 |
"public class Y {\n" + |
2294 |
" p.X x;\n" + |
2295 |
" p.Z z;\n" + |
2296 |
"}", |
2297 |
}, |
2298 |
"\"" + OUTPUT_DIR + File.separator + "Y.java\"" |
2299 |
+ " -1.5 -g -preserveAllLocals" |
2300 |
+ " -cp \"" + OUTPUT_DIR + "[~p/X" + File.pathSeparator + "-p/*]\"" |
2301 |
+ " -warn:-discouraged -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" |
2302 |
+ " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"", |
2303 |
"", |
2304 |
"----------\n" + |
2305 |
"1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/Y.java\n" + |
2306 |
" (at line 4)\n" + |
2307 |
" p.Z z;\n" + |
2308 |
" ^^^\n" + |
2309 |
"Access restriction: The type Z is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---\n" + |
2310 |
"----------\n" + |
2311 |
"1 problem (1 warning)", |
2312 |
false); |
2313 |
} |
2314 |
|
2315 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=124533 |
2316 |
// turn off discouraged references warnings |
2317 |
public void test042(){ |
2318 |
this.runConformTest( |
2319 |
new String[] { |
2320 |
"p/X.java", |
2321 |
"package p;\n" + |
2322 |
"/** */\n" + |
2323 |
"public class X {\n" + |
2324 |
"}", |
2325 |
"p/Z.java", |
2326 |
"package p;\n" + |
2327 |
"/** */\n" + |
2328 |
"public class Z {\n" + |
2329 |
"}" |
2330 |
}, |
2331 |
"\"" + OUTPUT_DIR + File.separator + "p" + File.separator + "X.java\"" |
2332 |
+ " \"" + OUTPUT_DIR + File.separator + "p" + File.separator + "Z.java\"" |
2333 |
+ " -1.5 -g -preserveAllLocals" |
2334 |
+ " -nowarn" |
2335 |
+ " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"", |
2336 |
"", |
2337 |
"", |
2338 |
true); |
2339 |
this.runConformTest( |
2340 |
new String[] { |
2341 |
"Y.java", |
2342 |
"/** */\n" + |
2343 |
"public class Y {\n" + |
2344 |
" p.X x;\n" + |
2345 |
" p.Z z;\n" + |
2346 |
"}", |
2347 |
}, |
2348 |
"\"" + OUTPUT_DIR + File.separator + "Y.java\"" |
2349 |
+ " -1.5 -g -preserveAllLocals" |
2350 |
+ " -cp \"" + OUTPUT_DIR + "[~p/X" + File.pathSeparator + "-p/*]\"" |
2351 |
+ " -warn:-forbidden -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" |
2352 |
+ " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"", |
2353 |
"", |
2354 |
"----------\n" + |
2355 |
"1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/Y.java\n" + |
2356 |
" (at line 3)\n" + |
2357 |
" p.X x;\n" + |
2358 |
" ^^^\n" + |
2359 |
"Discouraged access: The type X is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---\n" + |
2360 |
"----------\n" + |
2361 |
"1 problem (1 warning)", |
2362 |
false); |
2363 |
} |
2364 |
|
2365 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=124533 |
2366 |
// turn off discouraged references warnings |
2367 |
public void test043(){ |
2368 |
this.runConformTest( |
2369 |
new String[] { |
2370 |
"p/X.java", |
2371 |
"package p;\n" + |
2372 |
"/** */\n" + |
2373 |
"public class X {\n" + |
2374 |
"}", |
2375 |
"p/Z.java", |
2376 |
"package p;\n" + |
2377 |
"/** */\n" + |
2378 |
"public class Z {\n" + |
2379 |
"}" |
2380 |
}, |
2381 |
"\"" + OUTPUT_DIR + File.separator + "p" + File.separator + "X.java\"" |
2382 |
+ " \"" + OUTPUT_DIR + File.separator + "p" + File.separator + "Z.java\"" |
2383 |
+ " -1.5 -g -preserveAllLocals" |
2384 |
+ " -nowarn" |
2385 |
+ " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"", |
2386 |
"", |
2387 |
"", |
2388 |
true); |
2389 |
this.runConformTest( |
2390 |
new String[] { |
2391 |
"Y.java", |
2392 |
"/** */\n" + |
2393 |
"public class Y {\n" + |
2394 |
" p.X x;\n" + |
2395 |
" p.Z z;\n" + |
2396 |
"}", |
2397 |
}, |
2398 |
"\"" + OUTPUT_DIR + File.separator + "Y.java\"" |
2399 |
+ " -1.5 -g -preserveAllLocals" |
2400 |
+ " -cp \"" + OUTPUT_DIR + "[~p/X" + File.pathSeparator + "-p/*]\"" |
2401 |
+ " -warn:-discouraged,forbidden -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" |
2402 |
+ " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"", |
2403 |
"", |
2404 |
"", |
2405 |
false); |
2406 |
} |
2407 |
|
2216 |
public static Class testClass() { |
2408 |
public static Class testClass() { |
2217 |
return BatchCompilerTest.class; |
2409 |
return BatchCompilerTest.class; |
2218 |
} |
2410 |
} |