Lines 40592-40596
Link Here
|
40592 |
" ^^^^^^\n" + |
40592 |
" ^^^^^^\n" + |
40593 |
"Unused type arguments for the non generic constructor Local() of type Local; it should not be parameterized with arguments <String>\n" + |
40593 |
"Unused type arguments for the non generic constructor Local() of type Local; it should not be parameterized with arguments <String>\n" + |
40594 |
"----------\n"); |
40594 |
"----------\n"); |
|
|
40595 |
} |
40596 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=208873 |
40597 |
public void test1212() { |
40598 |
this.runConformTest( |
40599 |
new String[] { |
40600 |
"X.java", |
40601 |
"public class X {\n" + |
40602 |
" public interface Loader {\n" + |
40603 |
" public <T extends Integer, K extends String> T load(final K key);\n" + |
40604 |
" }\n" + |
40605 |
" Loader loader;\n" + |
40606 |
" public <K extends String, T extends Integer> T get(final K key) {\n" + |
40607 |
" T data = this.loader.load(key);\n" + |
40608 |
" return null;\n" + |
40609 |
" }\n" + |
40610 |
"}\n", // ================= |
40611 |
}, |
40612 |
""); |
40613 |
} |
40614 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=208873 - variation |
40615 |
public void test1213() { |
40616 |
this.runConformTest( |
40617 |
new String[] { |
40618 |
"X.java", |
40619 |
"public class X {\n" + |
40620 |
" <T, U extends T, V extends T> T cond1(boolean z, U x1, V x2) {\n" + |
40621 |
" return (z? x1: x2);\n" + |
40622 |
" }\n" + |
40623 |
"}\n", |
40624 |
}, |
40625 |
""); |
40626 |
} |
40627 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=209153 |
40628 |
public void test1214() { |
40629 |
this.runNegativeTest( |
40630 |
new String[] { |
40631 |
"X.java", |
40632 |
"public class X {\n" + |
40633 |
" public static void main(String[] args) {\n" + |
40634 |
" p.A myA = new p.A();\n" + |
40635 |
" myA.p = myA.box.get(); // [msgSend] generic cast to P -> error\n" + |
40636 |
" Object o = myA.box.get(); // ok, since no generic cast actually inserted\n" + |
40637 |
" myA.p = myA.getBox().t;// [fieldRef] generic cast to P -> error\n" + |
40638 |
" myA.p = myA.box.t;// [qName] generic cast to P -> error\n" + |
40639 |
" int pval = myA.box.t.pval;// intermediate access through P already flagged as error\n" + |
40640 |
" }\n" + |
40641 |
"}\n", |
40642 |
"p/A.java", |
40643 |
"package p;\n" + |
40644 |
"public class A {\n" + |
40645 |
" public static class Box<T> {\n" + |
40646 |
" public T t;\n" + |
40647 |
" public void set(T t) { this.t = t; }\n" + |
40648 |
" public T get() { return this.t; }\n" + |
40649 |
" }\n" + |
40650 |
" private class P {\n" + |
40651 |
" public int pval;\n" + |
40652 |
" }\n" + |
40653 |
" public P p;\n" + |
40654 |
" public Box<P> box;\n" + |
40655 |
" public Box<P> getBox() { return this.box; }\n" + |
40656 |
" public A next;\n" + |
40657 |
" public A getNext() { return this;} \n" + |
40658 |
" public A() {\n" + |
40659 |
" this.box = new Box<P>();\n" + |
40660 |
" this.box.set(new P());\n" + |
40661 |
" }\n" + |
40662 |
"}\n" |
40663 |
}, |
40664 |
"----------\n" + |
40665 |
"1. ERROR in X.java (at line 4)\n" + |
40666 |
" myA.p = myA.box.get(); // [msgSend] generic cast to P -> error\n" + |
40667 |
" ^^^^^^^^^^^^^\n" + |
40668 |
"The type A.P is not visible\n" + |
40669 |
"----------\n" + |
40670 |
"2. ERROR in X.java (at line 6)\n" + |
40671 |
" myA.p = myA.getBox().t;// [fieldRef] generic cast to P -> error\n" + |
40672 |
" ^^^^^^^^^^^^^^\n" + |
40673 |
"The type A.P is not visible\n" + |
40674 |
"----------\n" + |
40675 |
"3. ERROR in X.java (at line 7)\n" + |
40676 |
" myA.p = myA.box.t;// [qName] generic cast to P -> error\n" + |
40677 |
" ^^^\n" + |
40678 |
"The type A.P is not visible\n" + |
40679 |
"----------\n" + |
40680 |
"4. ERROR in X.java (at line 8)\n" + |
40681 |
" int pval = myA.box.t.pval;// intermediate access through P already flagged as error\n" + |
40682 |
" ^^^^^^^^^^^^^^\n" + |
40683 |
"The type A.P is not visible\n" + |
40684 |
"----------\n" + |
40685 |
"----------\n" + |
40686 |
"1. WARNING in p\\A.java (at line 18)\n" + |
40687 |
" this.box.set(new P());\n" + |
40688 |
" ^^^^^^^\n" + |
40689 |
"Access to enclosing constructor A.P() is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" + |
40690 |
"----------\n"); |
40691 |
} |
40692 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=209153 - variation |
40693 |
public void test1215() { |
40694 |
this.runNegativeTest( |
40695 |
new String[] { |
40696 |
"X.java", |
40697 |
"public class X {\n" + |
40698 |
" public static void main(String[] args) {\n" + |
40699 |
" p.A myA = new p.A();\n" + |
40700 |
" myA.p = myA.box.get(); // [msgSend] generic cast to P -> error\n" + |
40701 |
" Object o = myA.box.get(); // ok, since no generic cast actually inserted\n" + |
40702 |
" myA.p = myA.getBox().t;// [fieldRef] generic cast to P -> error\n" + |
40703 |
" myA.p = myA.box.t;// [qName] generic cast to P -> error\n" + |
40704 |
" int pval = myA.box.t.pval;// intermediate access through P already flagged as error\n" + |
40705 |
" }\n" + |
40706 |
"}\n", |
40707 |
"p/A.java", |
40708 |
"package p;\n" + |
40709 |
"public class A {\n" + |
40710 |
" public static class Box<T> {\n" + |
40711 |
" public T t;\n" + |
40712 |
" public void set(T t) { this.t = t; }\n" + |
40713 |
" public T get() { return this.t; }\n" + |
40714 |
" }\n" + |
40715 |
" protected class P {\n" + |
40716 |
" public int pval;\n" + |
40717 |
" }\n" + |
40718 |
" public P p;\n" + |
40719 |
" public Box<P> box;\n" + |
40720 |
" public Box<P> getBox() { return this.box; }\n" + |
40721 |
" public A next;\n" + |
40722 |
" public A getNext() { return this;} \n" + |
40723 |
" public A() {\n" + |
40724 |
" this.box = new Box<P>();\n" + |
40725 |
" this.box.set(new P());\n" + |
40726 |
" }\n" + |
40727 |
"}\n" |
40728 |
}, |
40729 |
"----------\n" + |
40730 |
"1. ERROR in X.java (at line 4)\n" + |
40731 |
" myA.p = myA.box.get(); // [msgSend] generic cast to P -> error\n" + |
40732 |
" ^^^^^^^^^^^^^\n" + |
40733 |
"The type A.P is not visible\n" + |
40734 |
"----------\n" + |
40735 |
"2. ERROR in X.java (at line 6)\n" + |
40736 |
" myA.p = myA.getBox().t;// [fieldRef] generic cast to P -> error\n" + |
40737 |
" ^^^^^^^^^^^^^^\n" + |
40738 |
"The type A.P is not visible\n" + |
40739 |
"----------\n" + |
40740 |
"3. ERROR in X.java (at line 7)\n" + |
40741 |
" myA.p = myA.box.t;// [qName] generic cast to P -> error\n" + |
40742 |
" ^^^\n" + |
40743 |
"The type A.P is not visible\n" + |
40744 |
"----------\n" + |
40745 |
"4. ERROR in X.java (at line 8)\n" + |
40746 |
" int pval = myA.box.t.pval;// intermediate access through P already flagged as error\n" + |
40747 |
" ^^^^^^^^^^^^^^\n" + |
40748 |
"The type A.P is not visible\n" + |
40749 |
"----------\n"); |
40750 |
} |
40751 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=209153 - variation |
40752 |
public void test1216() { |
40753 |
this.runNegativeTest( |
40754 |
new String[] { |
40755 |
"X.java", |
40756 |
"public class X {\n" + |
40757 |
" public static void main(String[] args) {\n" + |
40758 |
" p.A myA = new p.A();\n" + |
40759 |
" myA.p = myA.box.get(); // [msgSend] generic cast to P -> error\n" + |
40760 |
" Object o = myA.box.get(); // ok, since no generic cast actually inserted\n" + |
40761 |
" myA.p = myA.getBox().t;// [fieldRef] generic cast to P -> error\n" + |
40762 |
" myA.p = myA.box.t;// [qName] generic cast to P -> error\n" + |
40763 |
" int pval = myA.box.t.pval;// intermediate access through P already flagged as error\n" + |
40764 |
" }\n" + |
40765 |
"}\n", |
40766 |
"p/A.java", |
40767 |
"package p;\n" + |
40768 |
"public class A {\n" + |
40769 |
" public static class Box<T> {\n" + |
40770 |
" public T t;\n" + |
40771 |
" public void set(T t) { this.t = t; }\n" + |
40772 |
" public T get() { return this.t; }\n" + |
40773 |
" }\n" + |
40774 |
" class P {\n" + |
40775 |
" public int pval;\n" + |
40776 |
" }\n" + |
40777 |
" public P p;\n" + |
40778 |
" public Box<P> box;\n" + |
40779 |
" public Box<P> getBox() { return this.box; }\n" + |
40780 |
" public A next;\n" + |
40781 |
" public A getNext() { return this;} \n" + |
40782 |
" public A() {\n" + |
40783 |
" this.box = new Box<P>();\n" + |
40784 |
" this.box.set(new P());\n" + |
40785 |
" }\n" + |
40786 |
"}\n" |
40787 |
}, |
40788 |
"----------\n" + |
40789 |
"1. ERROR in X.java (at line 4)\n" + |
40790 |
" myA.p = myA.box.get(); // [msgSend] generic cast to P -> error\n" + |
40791 |
" ^^^^^^^^^^^^^\n" + |
40792 |
"The type A.P is not visible\n" + |
40793 |
"----------\n" + |
40794 |
"2. ERROR in X.java (at line 6)\n" + |
40795 |
" myA.p = myA.getBox().t;// [fieldRef] generic cast to P -> error\n" + |
40796 |
" ^^^^^^^^^^^^^^\n" + |
40797 |
"The type A.P is not visible\n" + |
40798 |
"----------\n" + |
40799 |
"3. ERROR in X.java (at line 7)\n" + |
40800 |
" myA.p = myA.box.t;// [qName] generic cast to P -> error\n" + |
40801 |
" ^^^\n" + |
40802 |
"The type A.P is not visible\n" + |
40803 |
"----------\n" + |
40804 |
"4. ERROR in X.java (at line 8)\n" + |
40805 |
" int pval = myA.box.t.pval;// intermediate access through P already flagged as error\n" + |
40806 |
" ^^^^^^^^^^^^^^\n" + |
40807 |
"The type A.P is not visible\n" + |
40808 |
"----------\n"); |
40595 |
} |
40809 |
} |
40596 |
} |
40810 |
} |