Lines 489-530
Link Here
|
489 |
"}\n", |
489 |
"}\n", |
490 |
}, |
490 |
}, |
491 |
"----------\n" + |
491 |
"----------\n" + |
492 |
"1. ERROR in X.java (at line 6)\r\n" + |
492 |
"1. ERROR in X.java (at line 3)\n" + |
|
|
493 |
" import static p.Z.Zz.WW;\n" + |
494 |
" ^^^^^^^^^\n" + |
495 |
"The import p.Z.Zz.WW collides with another import statement\n" + |
496 |
"----------\n" + |
497 |
"2. ERROR in X.java (at line 6)\r\n" + |
493 |
" import static p.Y.Zz;\r\n" + |
498 |
" import static p.Y.Zz;\r\n" + |
494 |
" ^^^^^^\n" + |
499 |
" ^^^^^^\n" + |
495 |
"The import p.Y.Zz cannot be resolved\n" + |
500 |
"The import p.Y.Zz cannot be resolved\n" + |
496 |
"----------\n" + |
501 |
"----------\n" + |
497 |
"2. ERROR in X.java (at line 7)\r\n" + |
502 |
"3. ERROR in X.java (at line 7)\r\n" + |
498 |
" import static p.Z.Zz.WW.*;\r\n" + |
503 |
" import static p.Z.Zz.WW.*;\r\n" + |
499 |
" ^^^^^^^^^\n" + |
504 |
" ^^^^^^^^^\n" + |
500 |
"The import p.Z.Zz.WW cannot be resolved\n" + |
505 |
"The import p.Z.Zz.WW cannot be resolved\n" + |
501 |
"----------\n" + |
506 |
"----------\n" + |
502 |
"3. ERROR in X.java (at line 8)\r\n" + |
507 |
"4. ERROR in X.java (at line 8)\r\n" + |
503 |
" import p.Y.ZZ;\r\n" + |
508 |
" import p.Y.ZZ;\r\n" + |
504 |
" ^^^^^^\n" + |
509 |
" ^^^^^^\n" + |
505 |
"The import p.Y.ZZ cannot be resolved\n" + |
510 |
"The import p.Y.ZZ cannot be resolved\n" + |
506 |
"----------\n" + |
511 |
"----------\n" + |
507 |
"4. ERROR in X.java (at line 9)\r\n" + |
512 |
"5. ERROR in X.java (at line 9)\r\n" + |
508 |
" import static p.Y.ZZ.*;\r\n" + |
513 |
" import static p.Y.ZZ.*;\r\n" + |
509 |
" ^^^^^^\n" + |
514 |
" ^^^^^^\n" + |
510 |
"The import p.Y.ZZ cannot be resolved\n" + |
515 |
"The import p.Y.ZZ cannot be resolved\n" + |
511 |
"----------\n" + |
516 |
"----------\n" + |
512 |
"5. ERROR in X.java (at line 10)\r\n" + |
517 |
"6. ERROR in X.java (at line 10)\r\n" + |
513 |
" import static p.Y.ZZ.WW;\r\n" + |
518 |
" import static p.Y.ZZ.WW;\r\n" + |
514 |
" ^^^^^^\n" + |
519 |
" ^^^^^^\n" + |
515 |
"The import p.Y.ZZ cannot be resolved\n" + |
520 |
"The import p.Y.ZZ cannot be resolved\n" + |
516 |
"----------\n" + |
521 |
"----------\n" + |
517 |
"6. ERROR in X.java (at line 11)\r\n" + |
522 |
"7. ERROR in X.java (at line 11)\r\n" + |
518 |
" import static p.Y.ZZ.WW.*;\r\n" + |
523 |
" import static p.Y.ZZ.WW.*;\r\n" + |
519 |
" ^^^^^^\n" + |
524 |
" ^^^^^^\n" + |
520 |
"The import p.Y.ZZ cannot be resolved\n" + |
525 |
"The import p.Y.ZZ cannot be resolved\n" + |
521 |
"----------\n" + |
526 |
"----------\n" + |
522 |
"7. ERROR in X.java (at line 12)\r\n" + |
527 |
"8. ERROR in X.java (at line 12)\r\n" + |
523 |
" import static p.Y.ZZ.ZZZ;\r\n" + |
528 |
" import static p.Y.ZZ.ZZZ;\r\n" + |
524 |
" ^^^^^^\n" + |
529 |
" ^^^^^^\n" + |
525 |
"The import p.Y.ZZ cannot be resolved\n" + |
530 |
"The import p.Y.ZZ cannot be resolved\n" + |
526 |
"----------\n" + |
531 |
"----------\n" + |
527 |
"8. ERROR in X.java (at line 13)\r\n" + |
532 |
"9. ERROR in X.java (at line 13)\r\n" + |
528 |
" import static p.Y.ZZ.WW.WWW;\r\n" + |
533 |
" import static p.Y.ZZ.WW.WWW;\r\n" + |
529 |
" ^^^^^^\n" + |
534 |
" ^^^^^^\n" + |
530 |
"The import p.Y.ZZ cannot be resolved\n" + |
535 |
"The import p.Y.ZZ cannot be resolved\n" + |
Lines 2533-2537
Link Here
|
2533 |
}, |
2538 |
}, |
2534 |
""); |
2539 |
""); |
2535 |
} |
2540 |
} |
|
|
2541 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=302865 |
2542 |
// To verify that a static import importing a type which has already been |
2543 |
// imported by a single type import is reported as duplicate |
2544 |
// while the other static members imported by it are not shadowed. |
2545 |
public void test075() { |
2546 |
this.runNegativeTest( |
2547 |
new String[] { |
2548 |
"A/A.java", |
2549 |
"package A;\n" + |
2550 |
"import B.B.C1;\n" + |
2551 |
"import static B.B.C1;\n" + |
2552 |
"public abstract class A {\n" + |
2553 |
" protected void A1(Object task) {\n" + |
2554 |
" C1 c = C1(task);\n" + |
2555 |
" }\n" + |
2556 |
"}\n", |
2557 |
"B/B.java", |
2558 |
"package B;\n" + |
2559 |
"final public class B {\n" + |
2560 |
" private B() {}\n" + |
2561 |
" public static class C1 {}\n" + |
2562 |
" public static C1 C1(Object o) {\n" + |
2563 |
" return new C1();\n" + |
2564 |
" }\n" + |
2565 |
"}\n", |
2566 |
}, |
2567 |
"----------\n" + |
2568 |
"1. ERROR in A\\A.java (at line 3)\n" + |
2569 |
" import static B.B.C1;\n" + |
2570 |
" ^^^^^^\n" + |
2571 |
"The import B.B.C1 collides with another import statement\n" + |
2572 |
"----------\n" |
2573 |
); |
2574 |
} |
2575 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=302865 |
2576 |
// To verify that a static import importing a static method doesnt collide |
2577 |
// with a single type import importing a non-static type with the same name as the method |
2578 |
public void test076() { |
2579 |
this.runConformTest( |
2580 |
new String[] { |
2581 |
"A/A.java", |
2582 |
"package A;\n" + |
2583 |
"import B.B.C1;\n" + |
2584 |
"import static B.B.C1;\n" + |
2585 |
"public class A {\n" + |
2586 |
" protected void A1(Object task) {\n" + |
2587 |
" C1 c1;\n" + |
2588 |
" int c = C1(task);\n" + |
2589 |
" }\n" + |
2590 |
"}\n", |
2591 |
"B/B.java", |
2592 |
"package B;\n" + |
2593 |
"final public class B {\n" + |
2594 |
" private B() {}\n" + |
2595 |
" public class C1 {}\n" + |
2596 |
" public static int C1(Object o) {\n" + |
2597 |
" return 1;\n" + |
2598 |
" }\n" + |
2599 |
"}\n", |
2600 |
}, |
2601 |
""); |
2602 |
} |
2536 |
} |
2603 |
} |
2537 |
|
2604 |
|