Lines 2273-2276
Link Here
|
2273 |
"" |
2273 |
"" |
2274 |
); |
2274 |
); |
2275 |
} |
2275 |
} |
|
|
2276 |
|
2277 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=214558 |
2278 |
public void test066() { |
2279 |
this.runNegativeTest( |
2280 |
new String[] { |
2281 |
"A.java", |
2282 |
"import java.util.*;\n" + |
2283 |
"public class A {\n" + |
2284 |
" void foo(Collection<Object[]> c) {}\n" + |
2285 |
" void foo(Collection<Object[]> c, Object o) {}\n" + |
2286 |
" public static void main(String[] args) {\n" + |
2287 |
" new B().foo(new ArrayList());\n" + |
2288 |
" new B().foo(new ArrayList(), args[0]);\n" + |
2289 |
" }\n" + |
2290 |
"}\n" + |
2291 |
"class B extends A {\n" + |
2292 |
" void foo(ArrayList a) {}\n" + |
2293 |
" void foo(ArrayList a, Object o) {}\n" + |
2294 |
"}" |
2295 |
}, |
2296 |
"----------\n" + |
2297 |
"1. ERROR in A.java (at line 6)\n" + |
2298 |
" new B().foo(new ArrayList());\n" + |
2299 |
" ^^^\n" + |
2300 |
"The method foo(ArrayList) is ambiguous for the type B\n" + |
2301 |
"----------\n" + |
2302 |
"2. WARNING in A.java (at line 6)\n" + |
2303 |
" new B().foo(new ArrayList());\n" + |
2304 |
" ^^^^^^^^^\n" + |
2305 |
"ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" + |
2306 |
"----------\n" + |
2307 |
"3. ERROR in A.java (at line 7)\n" + |
2308 |
" new B().foo(new ArrayList(), args[0]);\n" + |
2309 |
" ^^^\n" + |
2310 |
"The method foo(ArrayList, Object) is ambiguous for the type B\n" + |
2311 |
"----------\n" + |
2312 |
"4. WARNING in A.java (at line 7)\n" + |
2313 |
" new B().foo(new ArrayList(), args[0]);\n" + |
2314 |
" ^^^^^^^^^\n" + |
2315 |
"ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" + |
2316 |
"----------\n" + |
2317 |
"5. WARNING in A.java (at line 11)\n" + |
2318 |
" void foo(ArrayList a) {}\n" + |
2319 |
" ^^^^^^^^^\n" + |
2320 |
"ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" + |
2321 |
"----------\n" + |
2322 |
"6. WARNING in A.java (at line 12)\n" + |
2323 |
" void foo(ArrayList a, Object o) {}\n" + |
2324 |
" ^^^^^^^^^\n" + |
2325 |
"ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" + |
2326 |
"----------\n" |
2327 |
); |
2328 |
} |
2329 |
|
2330 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=214558 - positive case |
2331 |
public void test067() { |
2332 |
this.runConformTest( |
2333 |
new String[] { |
2334 |
"A.java", |
2335 |
"import java.util.*;\n" + |
2336 |
"public class A {\n" + |
2337 |
" void foo(Collection<Object[]> c) {}\n" + |
2338 |
" public static void main(String[] args) {\n" + |
2339 |
" new B().foo(new ArrayList<Object>());\n" + |
2340 |
" }\n" + |
2341 |
"}\n" + |
2342 |
"class B extends A {\n" + |
2343 |
" void foo(ArrayList<Object> a) {System.out.print(1);}\n" + |
2344 |
"}" |
2345 |
}, |
2346 |
"1" |
2347 |
); |
2348 |
} |
2276 |
} |
2349 |
} |