Lines 40642-40645
Link Here
|
40642 |
true /* flush output directory */, |
40642 |
true /* flush output directory */, |
40643 |
customOptions); |
40643 |
customOptions); |
40644 |
} |
40644 |
} |
|
|
40645 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=208873 |
40646 |
public void test1214() { |
40647 |
this.runConformTest( |
40648 |
new String[] { |
40649 |
"X.java", |
40650 |
"public class X {\n" + |
40651 |
" public interface Loader {\n" + |
40652 |
" public <T extends Integer, K extends String> T load(final K key);\n" + |
40653 |
" }\n" + |
40654 |
" Loader loader;\n" + |
40655 |
" public <K extends String, T extends Integer> T get(final K key) {\n" + |
40656 |
" T data = this.loader.load(key);\n" + |
40657 |
" return null;\n" + |
40658 |
" }\n" + |
40659 |
"}\n", // ================= |
40660 |
}, |
40661 |
""); |
40662 |
} |
40663 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=208873 - variation |
40664 |
public void test1215() { |
40665 |
this.runConformTest( |
40666 |
new String[] { |
40667 |
"X.java", |
40668 |
"public class X {\n" + |
40669 |
" <T, U extends T, V extends T> T cond1(boolean z, U x1, V x2) {\n" + |
40670 |
" return (z? x1: x2);\n" + |
40671 |
" }\n" + |
40672 |
"}\n", |
40673 |
}, |
40674 |
""); |
40675 |
} |
40676 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=209153 |
40677 |
public void test1216() { |
40678 |
this.runNegativeTest( |
40679 |
new String[] { |
40680 |
"X.java", |
40681 |
"public class X {\n" + |
40682 |
" public static void main(String[] args) {\n" + |
40683 |
" p.A myA = new p.A();\n" + |
40684 |
" myA.p = myA.box.get(); // [msgSend] generic cast to P -> error\n" + |
40685 |
" Object o = myA.box.get(); // ok, since no generic cast actually inserted\n" + |
40686 |
" myA.p = myA.getBox().t;// [fieldRef] generic cast to P -> error\n" + |
40687 |
" myA.p = myA.box.t;// [qName] generic cast to P -> error\n" + |
40688 |
" int pval = myA.box.t.pval;// intermediate access through P already flagged as error\n" + |
40689 |
" }\n" + |
40690 |
"}\n", |
40691 |
"p/A.java", |
40692 |
"package p;\n" + |
40693 |
"public class A {\n" + |
40694 |
" public static class Box<T> {\n" + |
40695 |
" public T t;\n" + |
40696 |
" public void set(T t) { this.t = t; }\n" + |
40697 |
" public T get() { return this.t; }\n" + |
40698 |
" }\n" + |
40699 |
" private class P {\n" + |
40700 |
" public int pval;\n" + |
40701 |
" }\n" + |
40702 |
" public P p;\n" + |
40703 |
" public Box<P> box;\n" + |
40704 |
" public Box<P> getBox() { return this.box; }\n" + |
40705 |
" public A next;\n" + |
40706 |
" public A getNext() { return this;} \n" + |
40707 |
" public A() {\n" + |
40708 |
" this.box = new Box<P>();\n" + |
40709 |
" this.box.set(new P());\n" + |
40710 |
" }\n" + |
40711 |
"}\n" |
40712 |
}, |
40713 |
"----------\n" + |
40714 |
"1. ERROR in X.java (at line 4)\n" + |
40715 |
" myA.p = myA.box.get(); // [msgSend] generic cast to P -> error\n" + |
40716 |
" ^^^^^^^^^^^^^\n" + |
40717 |
"The type A.P is not visible\n" + |
40718 |
"----------\n" + |
40719 |
"2. ERROR in X.java (at line 6)\n" + |
40720 |
" myA.p = myA.getBox().t;// [fieldRef] generic cast to P -> error\n" + |
40721 |
" ^^^^^^^^^^^^^^\n" + |
40722 |
"The type A.P is not visible\n" + |
40723 |
"----------\n" + |
40724 |
"3. ERROR in X.java (at line 7)\n" + |
40725 |
" myA.p = myA.box.t;// [qName] generic cast to P -> error\n" + |
40726 |
" ^^^\n" + |
40727 |
"The type A.P is not visible\n" + |
40728 |
"----------\n" + |
40729 |
"4. ERROR in X.java (at line 8)\n" + |
40730 |
" int pval = myA.box.t.pval;// intermediate access through P already flagged as error\n" + |
40731 |
" ^^^^^^^^^^^^^^\n" + |
40732 |
"The type A.P is not visible\n" + |
40733 |
"----------\n" + |
40734 |
"----------\n" + |
40735 |
"1. WARNING in p\\A.java (at line 18)\n" + |
40736 |
" this.box.set(new P());\n" + |
40737 |
" ^^^^^^^\n" + |
40738 |
"Access to enclosing constructor A.P() is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" + |
40739 |
"----------\n"); |
40740 |
} |
40741 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=209153 - variation |
40742 |
public void test1217() { |
40743 |
this.runNegativeTest( |
40744 |
new String[] { |
40745 |
"X.java", |
40746 |
"public class X {\n" + |
40747 |
" public static void main(String[] args) {\n" + |
40748 |
" p.A myA = new p.A();\n" + |
40749 |
" myA.p = myA.box.get(); // [msgSend] generic cast to P -> error\n" + |
40750 |
" Object o = myA.box.get(); // ok, since no generic cast actually inserted\n" + |
40751 |
" myA.p = myA.getBox().t;// [fieldRef] generic cast to P -> error\n" + |
40752 |
" myA.p = myA.box.t;// [qName] generic cast to P -> error\n" + |
40753 |
" int pval = myA.box.t.pval;// intermediate access through P already flagged as error\n" + |
40754 |
" }\n" + |
40755 |
"}\n", |
40756 |
"p/A.java", |
40757 |
"package p;\n" + |
40758 |
"public class A {\n" + |
40759 |
" public static class Box<T> {\n" + |
40760 |
" public T t;\n" + |
40761 |
" public void set(T t) { this.t = t; }\n" + |
40762 |
" public T get() { return this.t; }\n" + |
40763 |
" }\n" + |
40764 |
" protected class P {\n" + |
40765 |
" public int pval;\n" + |
40766 |
" }\n" + |
40767 |
" public P p;\n" + |
40768 |
" public Box<P> box;\n" + |
40769 |
" public Box<P> getBox() { return this.box; }\n" + |
40770 |
" public A next;\n" + |
40771 |
" public A getNext() { return this;} \n" + |
40772 |
" public A() {\n" + |
40773 |
" this.box = new Box<P>();\n" + |
40774 |
" this.box.set(new P());\n" + |
40775 |
" }\n" + |
40776 |
"}\n" |
40777 |
}, |
40778 |
"----------\n" + |
40779 |
"1. ERROR in X.java (at line 4)\n" + |
40780 |
" myA.p = myA.box.get(); // [msgSend] generic cast to P -> error\n" + |
40781 |
" ^^^^^^^^^^^^^\n" + |
40782 |
"The type A.P is not visible\n" + |
40783 |
"----------\n" + |
40784 |
"2. ERROR in X.java (at line 6)\n" + |
40785 |
" myA.p = myA.getBox().t;// [fieldRef] generic cast to P -> error\n" + |
40786 |
" ^^^^^^^^^^^^^^\n" + |
40787 |
"The type A.P is not visible\n" + |
40788 |
"----------\n" + |
40789 |
"3. ERROR in X.java (at line 7)\n" + |
40790 |
" myA.p = myA.box.t;// [qName] generic cast to P -> error\n" + |
40791 |
" ^^^\n" + |
40792 |
"The type A.P is not visible\n" + |
40793 |
"----------\n" + |
40794 |
"4. ERROR in X.java (at line 8)\n" + |
40795 |
" int pval = myA.box.t.pval;// intermediate access through P already flagged as error\n" + |
40796 |
" ^^^^^^^^^^^^^^\n" + |
40797 |
"The type A.P is not visible\n" + |
40798 |
"----------\n"); |
40799 |
} |
40800 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=209153 - variation |
40801 |
public void test1218() { |
40802 |
this.runNegativeTest( |
40803 |
new String[] { |
40804 |
"X.java", |
40805 |
"public class X {\n" + |
40806 |
" public static void main(String[] args) {\n" + |
40807 |
" p.A myA = new p.A();\n" + |
40808 |
" myA.p = myA.box.get(); // [msgSend] generic cast to P -> error\n" + |
40809 |
" Object o = myA.box.get(); // ok, since no generic cast actually inserted\n" + |
40810 |
" myA.p = myA.getBox().t;// [fieldRef] generic cast to P -> error\n" + |
40811 |
" myA.p = myA.box.t;// [qName] generic cast to P -> error\n" + |
40812 |
" int pval = myA.box.t.pval;// intermediate access through P already flagged as error\n" + |
40813 |
" }\n" + |
40814 |
"}\n", |
40815 |
"p/A.java", |
40816 |
"package p;\n" + |
40817 |
"public class A {\n" + |
40818 |
" public static class Box<T> {\n" + |
40819 |
" public T t;\n" + |
40820 |
" public void set(T t) { this.t = t; }\n" + |
40821 |
" public T get() { return this.t; }\n" + |
40822 |
" }\n" + |
40823 |
" class P {\n" + |
40824 |
" public int pval;\n" + |
40825 |
" }\n" + |
40826 |
" public P p;\n" + |
40827 |
" public Box<P> box;\n" + |
40828 |
" public Box<P> getBox() { return this.box; }\n" + |
40829 |
" public A next;\n" + |
40830 |
" public A getNext() { return this;} \n" + |
40831 |
" public A() {\n" + |
40832 |
" this.box = new Box<P>();\n" + |
40833 |
" this.box.set(new P());\n" + |
40834 |
" }\n" + |
40835 |
"}\n" |
40836 |
}, |
40837 |
"----------\n" + |
40838 |
"1. ERROR in X.java (at line 4)\n" + |
40839 |
" myA.p = myA.box.get(); // [msgSend] generic cast to P -> error\n" + |
40840 |
" ^^^^^^^^^^^^^\n" + |
40841 |
"The type A.P is not visible\n" + |
40842 |
"----------\n" + |
40843 |
"2. ERROR in X.java (at line 6)\n" + |
40844 |
" myA.p = myA.getBox().t;// [fieldRef] generic cast to P -> error\n" + |
40845 |
" ^^^^^^^^^^^^^^\n" + |
40846 |
"The type A.P is not visible\n" + |
40847 |
"----------\n" + |
40848 |
"3. ERROR in X.java (at line 7)\n" + |
40849 |
" myA.p = myA.box.t;// [qName] generic cast to P -> error\n" + |
40850 |
" ^^^\n" + |
40851 |
"The type A.P is not visible\n" + |
40852 |
"----------\n" + |
40853 |
"4. ERROR in X.java (at line 8)\n" + |
40854 |
" int pval = myA.box.t.pval;// intermediate access through P already flagged as error\n" + |
40855 |
" ^^^^^^^^^^^^^^\n" + |
40856 |
"The type A.P is not visible\n" + |
40857 |
"----------\n"); |
40858 |
} |
40859 |
|
40645 |
} |
40860 |
} |