Lines 38884-38888
Link Here
|
38884 |
"Bound mismatch: The generic method throwE(Object...) of type X is not applicable for the arguments (Object[]). The inferred type Object[] is not a valid substitute for the bounded parameter <E extends Exception>\n" + |
38884 |
"Bound mismatch: The generic method throwE(Object...) of type X is not applicable for the arguments (Object[]). The inferred type Object[] is not a valid substitute for the bounded parameter <E extends Exception>\n" + |
38885 |
"----------\n"); |
38885 |
"----------\n"); |
38886 |
} |
38886 |
} |
|
|
38887 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=208873 |
38888 |
public void test1212() { |
38889 |
this.runConformTest( |
38890 |
new String[] { |
38891 |
"X.java", |
38892 |
"public class X {\n" + |
38893 |
" public interface Loader {\n" + |
38894 |
" public <T extends Integer, K extends String> T load(final K key);\n" + |
38895 |
" }\n" + |
38896 |
" Loader loader;\n" + |
38897 |
" public <K extends String, T extends Integer> T get(final K key) {\n" + |
38898 |
" T data = this.loader.load(key);\n" + |
38899 |
" return null;\n" + |
38900 |
" }\n" + |
38901 |
"}\n", // ================= |
38902 |
}, |
38903 |
""); |
38904 |
} |
38905 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=208873 - variation |
38906 |
public void test1213() { |
38907 |
this.runConformTest( |
38908 |
new String[] { |
38909 |
"X.java", |
38910 |
"public class X {\n" + |
38911 |
" <T, U extends T, V extends T> T cond1(boolean z, U x1, V x2) {\n" + |
38912 |
" return (z? x1: x2);\n" + |
38913 |
" }\n" + |
38914 |
"}\n", |
38915 |
}, |
38916 |
""); |
38917 |
} |
38918 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=209153 |
38919 |
public void test1214() { |
38920 |
this.runNegativeTest( |
38921 |
new String[] { |
38922 |
"X.java", |
38923 |
"public class X {\n" + |
38924 |
" public static void main(String[] args) {\n" + |
38925 |
" p.A myA = new p.A();\n" + |
38926 |
" myA.p = myA.box.get(); // [msgSend] generic cast to P -> error\n" + |
38927 |
" Object o = myA.box.get(); // ok, since no generic cast actually inserted\n" + |
38928 |
" myA.p = myA.getBox().t;// [fieldRef] generic cast to P -> error\n" + |
38929 |
" myA.p = myA.box.t;// [qName] generic cast to P -> error\n" + |
38930 |
" int pval = myA.box.t.pval;// intermediate access through P already flagged as error\n" + |
38931 |
" }\n" + |
38932 |
"}\n", |
38933 |
"p/A.java", |
38934 |
"package p;\n" + |
38935 |
"public class A {\n" + |
38936 |
" public static class Box<T> {\n" + |
38937 |
" public T t;\n" + |
38938 |
" public void set(T t) { this.t = t; }\n" + |
38939 |
" public T get() { return this.t; }\n" + |
38940 |
" }\n" + |
38941 |
" private class P {\n" + |
38942 |
" public int pval;\n" + |
38943 |
" }\n" + |
38944 |
" public P p;\n" + |
38945 |
" public Box<P> box;\n" + |
38946 |
" public Box<P> getBox() { return this.box; }\n" + |
38947 |
" public A next;\n" + |
38948 |
" public A getNext() { return this;} \n" + |
38949 |
" public A() {\n" + |
38950 |
" this.box = new Box<P>();\n" + |
38951 |
" this.box.set(new P());\n" + |
38952 |
" }\n" + |
38953 |
"}\n" |
38954 |
}, |
38955 |
"----------\n" + |
38956 |
"1. ERROR in X.java (at line 4)\n" + |
38957 |
" myA.p = myA.box.get(); // [msgSend] generic cast to P -> error\n" + |
38958 |
" ^^^^^^^^^^^^^\n" + |
38959 |
"The type A.P is not visible\n" + |
38960 |
"----------\n" + |
38961 |
"2. ERROR in X.java (at line 6)\n" + |
38962 |
" myA.p = myA.getBox().t;// [fieldRef] generic cast to P -> error\n" + |
38963 |
" ^^^^^^^^^^^^^^\n" + |
38964 |
"The type A.P is not visible\n" + |
38965 |
"----------\n" + |
38966 |
"3. ERROR in X.java (at line 7)\n" + |
38967 |
" myA.p = myA.box.t;// [qName] generic cast to P -> error\n" + |
38968 |
" ^^^\n" + |
38969 |
"The type A.P is not visible\n" + |
38970 |
"----------\n" + |
38971 |
"4. ERROR in X.java (at line 8)\n" + |
38972 |
" int pval = myA.box.t.pval;// intermediate access through P already flagged as error\n" + |
38973 |
" ^^^^^^^^^^^^^^\n" + |
38974 |
"The type A.P is not visible\n" + |
38975 |
"----------\n" + |
38976 |
"----------\n" + |
38977 |
"1. WARNING in p\\A.java (at line 18)\n" + |
38978 |
" this.box.set(new P());\n" + |
38979 |
" ^^^^^^^\n" + |
38980 |
"Access to enclosing constructor A.P() is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" + |
38981 |
"----------\n"); |
38982 |
} |
38983 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=209153 - variation |
38984 |
public void test1215() { |
38985 |
this.runNegativeTest( |
38986 |
new String[] { |
38987 |
"X.java", |
38988 |
"public class X {\n" + |
38989 |
" public static void main(String[] args) {\n" + |
38990 |
" p.A myA = new p.A();\n" + |
38991 |
" myA.p = myA.box.get(); // [msgSend] generic cast to P -> error\n" + |
38992 |
" Object o = myA.box.get(); // ok, since no generic cast actually inserted\n" + |
38993 |
" myA.p = myA.getBox().t;// [fieldRef] generic cast to P -> error\n" + |
38994 |
" myA.p = myA.box.t;// [qName] generic cast to P -> error\n" + |
38995 |
" int pval = myA.box.t.pval;// intermediate access through P already flagged as error\n" + |
38996 |
" }\n" + |
38997 |
"}\n", |
38998 |
"p/A.java", |
38999 |
"package p;\n" + |
39000 |
"public class A {\n" + |
39001 |
" public static class Box<T> {\n" + |
39002 |
" public T t;\n" + |
39003 |
" public void set(T t) { this.t = t; }\n" + |
39004 |
" public T get() { return this.t; }\n" + |
39005 |
" }\n" + |
39006 |
" protected class P {\n" + |
39007 |
" public int pval;\n" + |
39008 |
" }\n" + |
39009 |
" public P p;\n" + |
39010 |
" public Box<P> box;\n" + |
39011 |
" public Box<P> getBox() { return this.box; }\n" + |
39012 |
" public A next;\n" + |
39013 |
" public A getNext() { return this;} \n" + |
39014 |
" public A() {\n" + |
39015 |
" this.box = new Box<P>();\n" + |
39016 |
" this.box.set(new P());\n" + |
39017 |
" }\n" + |
39018 |
"}\n" |
39019 |
}, |
39020 |
"----------\n" + |
39021 |
"1. ERROR in X.java (at line 4)\n" + |
39022 |
" myA.p = myA.box.get(); // [msgSend] generic cast to P -> error\n" + |
39023 |
" ^^^^^^^^^^^^^\n" + |
39024 |
"The type A.P is not visible\n" + |
39025 |
"----------\n" + |
39026 |
"2. ERROR in X.java (at line 6)\n" + |
39027 |
" myA.p = myA.getBox().t;// [fieldRef] generic cast to P -> error\n" + |
39028 |
" ^^^^^^^^^^^^^^\n" + |
39029 |
"The type A.P is not visible\n" + |
39030 |
"----------\n" + |
39031 |
"3. ERROR in X.java (at line 7)\n" + |
39032 |
" myA.p = myA.box.t;// [qName] generic cast to P -> error\n" + |
39033 |
" ^^^\n" + |
39034 |
"The type A.P is not visible\n" + |
39035 |
"----------\n" + |
39036 |
"4. ERROR in X.java (at line 8)\n" + |
39037 |
" int pval = myA.box.t.pval;// intermediate access through P already flagged as error\n" + |
39038 |
" ^^^^^^^^^^^^^^\n" + |
39039 |
"The type A.P is not visible\n" + |
39040 |
"----------\n"); |
39041 |
} |
39042 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=209153 - variation |
39043 |
public void test1216() { |
39044 |
this.runNegativeTest( |
39045 |
new String[] { |
39046 |
"X.java", |
39047 |
"public class X {\n" + |
39048 |
" public static void main(String[] args) {\n" + |
39049 |
" p.A myA = new p.A();\n" + |
39050 |
" myA.p = myA.box.get(); // [msgSend] generic cast to P -> error\n" + |
39051 |
" Object o = myA.box.get(); // ok, since no generic cast actually inserted\n" + |
39052 |
" myA.p = myA.getBox().t;// [fieldRef] generic cast to P -> error\n" + |
39053 |
" myA.p = myA.box.t;// [qName] generic cast to P -> error\n" + |
39054 |
" int pval = myA.box.t.pval;// intermediate access through P already flagged as error\n" + |
39055 |
" }\n" + |
39056 |
"}\n", |
39057 |
"p/A.java", |
39058 |
"package p;\n" + |
39059 |
"public class A {\n" + |
39060 |
" public static class Box<T> {\n" + |
39061 |
" public T t;\n" + |
39062 |
" public void set(T t) { this.t = t; }\n" + |
39063 |
" public T get() { return this.t; }\n" + |
39064 |
" }\n" + |
39065 |
" class P {\n" + |
39066 |
" public int pval;\n" + |
39067 |
" }\n" + |
39068 |
" public P p;\n" + |
39069 |
" public Box<P> box;\n" + |
39070 |
" public Box<P> getBox() { return this.box; }\n" + |
39071 |
" public A next;\n" + |
39072 |
" public A getNext() { return this;} \n" + |
39073 |
" public A() {\n" + |
39074 |
" this.box = new Box<P>();\n" + |
39075 |
" this.box.set(new P());\n" + |
39076 |
" }\n" + |
39077 |
"}\n" |
39078 |
}, |
39079 |
"----------\n" + |
39080 |
"1. ERROR in X.java (at line 4)\n" + |
39081 |
" myA.p = myA.box.get(); // [msgSend] generic cast to P -> error\n" + |
39082 |
" ^^^^^^^^^^^^^\n" + |
39083 |
"The type A.P is not visible\n" + |
39084 |
"----------\n" + |
39085 |
"2. ERROR in X.java (at line 6)\n" + |
39086 |
" myA.p = myA.getBox().t;// [fieldRef] generic cast to P -> error\n" + |
39087 |
" ^^^^^^^^^^^^^^\n" + |
39088 |
"The type A.P is not visible\n" + |
39089 |
"----------\n" + |
39090 |
"3. ERROR in X.java (at line 7)\n" + |
39091 |
" myA.p = myA.box.t;// [qName] generic cast to P -> error\n" + |
39092 |
" ^^^\n" + |
39093 |
"The type A.P is not visible\n" + |
39094 |
"----------\n" + |
39095 |
"4. ERROR in X.java (at line 8)\n" + |
39096 |
" int pval = myA.box.t.pval;// intermediate access through P already flagged as error\n" + |
39097 |
" ^^^^^^^^^^^^^^\n" + |
39098 |
"The type A.P is not visible\n" + |
39099 |
"----------\n"); |
39100 |
} |
38887 |
|
39101 |
|
38888 |
} |
39102 |
} |