Lines 13989-14009
Link Here
|
13989 |
" }\n" + |
13989 |
" }\n" + |
13990 |
"}\n" |
13990 |
"}\n" |
13991 |
}, |
13991 |
}, |
13992 |
"----------\n" + |
13992 |
"----------\n" + |
13993 |
"1. ERROR in X.java (at line 3)\n" + |
13993 |
"1. ERROR in X.java (at line 3)\n" + |
13994 |
" Zork z;\n" + |
13994 |
" Zork z;\n" + |
13995 |
" ^^^^\n" + |
13995 |
" ^^^^\n" + |
13996 |
"Zork cannot be resolved to a type\n" + |
13996 |
"Zork cannot be resolved to a type\n" + |
13997 |
"----------\n" + |
13997 |
"----------\n" + |
13998 |
"2. WARNING in X.java (at line 16)\n" + |
13998 |
"2. WARNING in X.java (at line 16)\n" + |
13999 |
" return m_manager.getById(getClass(), new Integer(1));\n" + |
13999 |
" return m_manager.getById(getClass(), new Integer(1));\n" + |
14000 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
14000 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
14001 |
"Type safety: Unchecked invocation getById(Class<capture#1-of ? extends Test>, Integer) of the generic method getById(Class<T>, Integer) of type Test.Manager<C>\n" + |
14001 |
"Type safety: Unchecked invocation getById(Class<capture#1-of ? extends Test>, Integer) of the generic method getById(Class<T>, Integer) of type Test.Manager<C>\n" + |
14002 |
"----------\n" + |
14002 |
"----------\n" + |
14003 |
"3. WARNING in X.java (at line 16)\n" + |
14003 |
"3. WARNING in X.java (at line 16)\n" + |
14004 |
" return m_manager.getById(getClass(), new Integer(1));\n" + |
14004 |
" return m_manager.getById(getClass(), new Integer(1));\n" + |
14005 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
14005 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
14006 |
"Type safety: The expression of type capture#1-of ? extends Test needs unchecked conversion to conform to ITest<C>\n" + |
14006 |
"Type safety: The expression of type ITest needs unchecked conversion to conform to ITest<C>\n" + |
14007 |
"----------\n"); |
14007 |
"----------\n"); |
14008 |
} |
14008 |
} |
14009 |
|
14009 |
|
Lines 15121-15141
Link Here
|
15121 |
" }\n" + |
15121 |
" }\n" + |
15122 |
"}\n" |
15122 |
"}\n" |
15123 |
}, |
15123 |
}, |
15124 |
"----------\n" + |
15124 |
"----------\n" + |
15125 |
"1. WARNING in X.java (at line 8)\n" + |
15125 |
"1. WARNING in X.java (at line 8)\n" + |
15126 |
" take(new A());\n" + |
15126 |
" take(new A());\n" + |
15127 |
" ^^^^^^^\n" + |
15127 |
" ^^^^^^^^^^^^^\n" + |
15128 |
"Type safety: The expression of type Super.A needs unchecked conversion to conform to Super<Double>.A<Double>\n" + |
15128 |
"Type safety: Unchecked invocation take(Super.A) of the generic method take(Super<S>.A<S>) of type Super<Double>\n" + |
15129 |
"----------\n" + |
15129 |
"----------\n" + |
15130 |
"2. WARNING in X.java (at line 8)\n" + |
15130 |
"2. WARNING in X.java (at line 8)\n" + |
15131 |
" take(new A());\n" + |
15131 |
" take(new A());\n" + |
15132 |
" ^\n" + |
15132 |
" ^^^^^^^\n" + |
15133 |
"Super.A is a raw type. References to generic type Super<S>.A<E> should be parameterized\n" + |
15133 |
"Type safety: The expression of type Super.A needs unchecked conversion to conform to Super<Double>.A<Double>\n" + |
15134 |
"----------\n" + |
15134 |
"----------\n" + |
15135 |
"3. ERROR in X.java (at line 14)\n" + |
15135 |
"3. WARNING in X.java (at line 8)\n" + |
15136 |
" Zork z;\n" + |
15136 |
" take(new A());\n" + |
15137 |
" ^^^^\n" + |
15137 |
" ^\n" + |
15138 |
"Zork cannot be resolved to a type\n" + |
15138 |
"Super.A is a raw type. References to generic type Super<S>.A<E> should be parameterized\n" + |
|
|
15139 |
"----------\n" + |
15140 |
"4. ERROR in X.java (at line 14)\n" + |
15141 |
" Zork z;\n" + |
15142 |
" ^^^^\n" + |
15143 |
"Zork cannot be resolved to a type\n" + |
15139 |
"----------\n"); |
15144 |
"----------\n"); |
15140 |
} |
15145 |
} |
15141 |
|
15146 |
|
Lines 15734-15814
Link Here
|
15734 |
" Zork z;\n" + |
15739 |
" Zork z;\n" + |
15735 |
"}\n" |
15740 |
"}\n" |
15736 |
}, |
15741 |
}, |
15737 |
"----------\n" + |
15742 |
"----------\n" + |
15738 |
"1. WARNING in X.java (at line 6)\n" + |
15743 |
"1. WARNING in X.java (at line 6)\n" + |
15739 |
" public void test(List list,final Comparator comparator, X x) {\n" + |
15744 |
" public void test(List list,final Comparator comparator, X x) {\n" + |
15740 |
" ^^^^\n" + |
15745 |
" ^^^^\n" + |
15741 |
"List is a raw type. References to generic type List<E> should be parameterized\n" + |
15746 |
"List is a raw type. References to generic type List<E> should be parameterized\n" + |
15742 |
"----------\n" + |
15747 |
"----------\n" + |
15743 |
"2. WARNING in X.java (at line 6)\n" + |
15748 |
"2. WARNING in X.java (at line 6)\n" + |
15744 |
" public void test(List list,final Comparator comparator, X x) {\n" + |
15749 |
" public void test(List list,final Comparator comparator, X x) {\n" + |
15745 |
" ^^^^^^^^^^\n" + |
15750 |
" ^^^^^^^^^^\n" + |
15746 |
"Comparator is a raw type. References to generic type Comparator<T> should be parameterized\n" + |
15751 |
"Comparator is a raw type. References to generic type Comparator<T> should be parameterized\n" + |
15747 |
"----------\n" + |
15752 |
"----------\n" + |
15748 |
"3. WARNING in X.java (at line 6)\n" + |
15753 |
"3. WARNING in X.java (at line 6)\n" + |
15749 |
" public void test(List list,final Comparator comparator, X x) {\n" + |
15754 |
" public void test(List list,final Comparator comparator, X x) {\n" + |
15750 |
" ^\n" + |
15755 |
" ^\n" + |
15751 |
"X is a raw type. References to generic type X<E> should be parameterized\n" + |
15756 |
"X is a raw type. References to generic type X<E> should be parameterized\n" + |
15752 |
"----------\n" + |
15757 |
"----------\n" + |
15753 |
"4. WARNING in X.java (at line 7)\n" + |
15758 |
"4. WARNING in X.java (at line 7)\n" + |
15754 |
" foo(list, comparator);\n" + |
15759 |
" foo(list, comparator);\n" + |
15755 |
" ^^^^^^^^^^^^^^^^^^^^^\n" + |
15760 |
" ^^^^^^^^^^^^^^^^^^^^^\n" + |
15756 |
"Type safety: Unchecked invocation foo(List, Comparator) of the generic method foo(List<T>, Comparator<? super T>) of type X<E>\n" + |
15761 |
"Type safety: Unchecked invocation foo(List, Comparator) of the generic method foo(List<T>, Comparator<? super T>) of type X<E>\n" + |
15757 |
"----------\n" + |
15762 |
"----------\n" + |
15758 |
"5. WARNING in X.java (at line 7)\n" + |
15763 |
"5. WARNING in X.java (at line 7)\n" + |
15759 |
" foo(list, comparator);\n" + |
15764 |
" foo(list, comparator);\n" + |
15760 |
" ^^^^\n" + |
15765 |
" ^^^^\n" + |
15761 |
"Type safety: The expression of type List needs unchecked conversion to conform to List<T>\n" + |
15766 |
"Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" + |
15762 |
"----------\n" + |
15767 |
"----------\n" + |
15763 |
"6. WARNING in X.java (at line 7)\n" + |
15768 |
"6. WARNING in X.java (at line 7)\n" + |
15764 |
" foo(list, comparator);\n" + |
15769 |
" foo(list, comparator);\n" + |
15765 |
" ^^^^^^^^^^\n" + |
15770 |
" ^^^^^^^^^^\n" + |
15766 |
"Type safety: The expression of type Comparator needs unchecked conversion to conform to Comparator<? super T>\n" + |
15771 |
"Type safety: The expression of type Comparator needs unchecked conversion to conform to Comparator<? super Object>\n" + |
15767 |
"----------\n" + |
15772 |
"----------\n" + |
15768 |
"7. WARNING in X.java (at line 8)\n" + |
15773 |
"7. WARNING in X.java (at line 8)\n" + |
15769 |
" bar(list, comparator);\n" + |
15774 |
" bar(list, comparator);\n" + |
15770 |
" ^^^^^^^^^^^^^^^^^^^^^\n" + |
15775 |
" ^^^^^^^^^^^^^^^^^^^^^\n" + |
15771 |
"Type safety: Unchecked invocation bar(List, Comparator) of the generic method bar(List<T>, Comparator<? super T>) of type X<E>\n" + |
15776 |
"Type safety: Unchecked invocation bar(List, Comparator) of the generic method bar(List<T>, Comparator<? super T>) of type X<E>\n" + |
15772 |
"----------\n" + |
15777 |
"----------\n" + |
15773 |
"8. WARNING in X.java (at line 8)\n" + |
15778 |
"8. WARNING in X.java (at line 8)\n" + |
15774 |
" bar(list, comparator);\n" + |
15779 |
" bar(list, comparator);\n" + |
15775 |
" ^^^^\n" + |
15780 |
" ^^^^\n" + |
15776 |
"Type safety: The expression of type List needs unchecked conversion to conform to List<T>\n" + |
15781 |
"Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" + |
15777 |
"----------\n" + |
15782 |
"----------\n" + |
15778 |
"9. WARNING in X.java (at line 8)\n" + |
15783 |
"9. WARNING in X.java (at line 8)\n" + |
15779 |
" bar(list, comparator);\n" + |
15784 |
" bar(list, comparator);\n" + |
15780 |
" ^^^^^^^^^^\n" + |
15785 |
" ^^^^^^^^^^\n" + |
15781 |
"Type safety: The expression of type Comparator needs unchecked conversion to conform to Comparator<? super T>\n" + |
15786 |
"Type safety: The expression of type Comparator needs unchecked conversion to conform to Comparator<? super Object>\n" + |
15782 |
"----------\n" + |
15787 |
"----------\n" + |
15783 |
"10. WARNING in X.java (at line 10)\n" + |
15788 |
"10. WARNING in X.java (at line 10)\n" + |
15784 |
" x.foo(list, comparator);\n" + |
15789 |
" x.foo(list, comparator);\n" + |
15785 |
" ^^^^^^^^^^^^^^^^^^^^^^^\n" + |
15790 |
" ^^^^^^^^^^^^^^^^^^^^^^^\n" + |
15786 |
"Type safety: The method foo(List, Comparator) belongs to the raw type X. References to generic type X<E> should be parameterized\n" + |
15791 |
"Type safety: The method foo(List, Comparator) belongs to the raw type X. References to generic type X<E> should be parameterized\n" + |
15787 |
"----------\n" + |
15792 |
"----------\n" + |
15788 |
"11. WARNING in X.java (at line 11)\n" + |
15793 |
"11. WARNING in X.java (at line 11)\n" + |
15789 |
" x.bar(list, comparator);\n" + |
15794 |
" x.bar(list, comparator);\n" + |
15790 |
" ^^^^^^^^^^^^^^^^^^^^^^^\n" + |
15795 |
" ^^^^^^^^^^^^^^^^^^^^^^^\n" + |
15791 |
"The static method bar(List, Comparator) from the type X should be accessed in a static way\n" + |
15796 |
"The static method bar(List<Object>, Comparator<? super Object>) from the type X should be accessed in a static way\n" + |
15792 |
"----------\n" + |
15797 |
"----------\n" + |
15793 |
"12. WARNING in X.java (at line 11)\n" + |
15798 |
"12. WARNING in X.java (at line 11)\n" + |
15794 |
" x.bar(list, comparator);\n" + |
15799 |
" x.bar(list, comparator);\n" + |
15795 |
" ^^^^^^^^^^^^^^^^^^^^^^^\n" + |
15800 |
" ^^^^^^^^^^^^^^^^^^^^^^^\n" + |
15796 |
"Type safety: Unchecked invocation bar(List, Comparator) of the generic method bar(List<T>, Comparator<? super T>) of type X\n" + |
15801 |
"Type safety: Unchecked invocation bar(List, Comparator) of the generic method bar(List<T>, Comparator<? super T>) of type X\n" + |
15797 |
"----------\n" + |
15802 |
"----------\n" + |
15798 |
"13. WARNING in X.java (at line 11)\n" + |
15803 |
"13. WARNING in X.java (at line 11)\n" + |
15799 |
" x.bar(list, comparator);\n" + |
15804 |
" x.bar(list, comparator);\n" + |
15800 |
" ^^^^\n" + |
15805 |
" ^^^^\n" + |
15801 |
"Type safety: The expression of type List needs unchecked conversion to conform to List<T>\n" + |
15806 |
"Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" + |
15802 |
"----------\n" + |
15807 |
"----------\n" + |
15803 |
"14. WARNING in X.java (at line 11)\n" + |
15808 |
"14. WARNING in X.java (at line 11)\n" + |
15804 |
" x.bar(list, comparator);\n" + |
15809 |
" x.bar(list, comparator);\n" + |
15805 |
" ^^^^^^^^^^\n" + |
15810 |
" ^^^^^^^^^^\n" + |
15806 |
"Type safety: The expression of type Comparator needs unchecked conversion to conform to Comparator<? super T>\n" + |
15811 |
"Type safety: The expression of type Comparator needs unchecked conversion to conform to Comparator<? super Object>\n" + |
15807 |
"----------\n" + |
15812 |
"----------\n" + |
15808 |
"15. ERROR in X.java (at line 18)\n" + |
15813 |
"15. ERROR in X.java (at line 18)\n" + |
15809 |
" Zork z;\n" + |
15814 |
" Zork z;\n" + |
15810 |
" ^^^^\n" + |
15815 |
" ^^^^\n" + |
15811 |
"Zork cannot be resolved to a type\n" + |
15816 |
"Zork cannot be resolved to a type\n" + |
15812 |
"----------\n"); |
15817 |
"----------\n"); |
15813 |
} |
15818 |
} |
15814 |
// array bound for wildcard |
15819 |
// array bound for wildcard |
Lines 16653-16688
Link Here
|
16653 |
" }\n" + |
16658 |
" }\n" + |
16654 |
"}\n", |
16659 |
"}\n", |
16655 |
}, |
16660 |
}, |
16656 |
"----------\n" + |
16661 |
"----------\n" + |
16657 |
"1. WARNING in X.java (at line 9)\n" + |
16662 |
"1. WARNING in X.java (at line 9)\n" + |
16658 |
" Class c = Foo.class;\n" + |
16663 |
" Class c = Foo.class;\n" + |
16659 |
" ^^^^^\n" + |
16664 |
" ^^^^^\n" + |
16660 |
"Class is a raw type. References to generic type Class<T> should be parameterized\n" + |
16665 |
"Class is a raw type. References to generic type Class<T> should be parameterized\n" + |
16661 |
"----------\n" + |
16666 |
"----------\n" + |
16662 |
"2. WARNING in X.java (at line 10)\n" + |
16667 |
"2. WARNING in X.java (at line 10)\n" + |
16663 |
" EnumSet<Enum> eSet = EnumSet.allOf(c);\n" + |
16668 |
" EnumSet<Enum> eSet = EnumSet.allOf(c);\n" + |
16664 |
" ^^^^\n" + |
16669 |
" ^^^^\n" + |
16665 |
"Enum is a raw type. References to generic type Enum<E> should be parameterized\n" + |
16670 |
"Enum is a raw type. References to generic type Enum<E> should be parameterized\n" + |
16666 |
"----------\n" + |
16671 |
"----------\n" + |
16667 |
"3. ERROR in X.java (at line 10)\n" + |
16672 |
"3. ERROR in X.java (at line 10)\n" + |
16668 |
" EnumSet<Enum> eSet = EnumSet.allOf(c);\n" + |
16673 |
" EnumSet<Enum> eSet = EnumSet.allOf(c);\n" + |
16669 |
" ^^^^\n" + |
16674 |
" ^^^^\n" + |
16670 |
"Bound mismatch: The type Enum is not a valid substitute for the bounded parameter <E extends Enum<E>> of the type EnumSet<E>\n" + |
16675 |
"Bound mismatch: The type Enum is not a valid substitute for the bounded parameter <E extends Enum<E>> of the type EnumSet<E>\n" + |
16671 |
"----------\n" + |
16676 |
"----------\n" + |
16672 |
"4. WARNING in X.java (at line 10)\n" + |
16677 |
"4. WARNING in X.java (at line 10)\n" + |
16673 |
" EnumSet<Enum> eSet = EnumSet.allOf(c);\n" + |
16678 |
" EnumSet<Enum> eSet = EnumSet.allOf(c);\n" + |
16674 |
" ^^^^^^^^^^^^^^^^\n" + |
16679 |
" ^^^^^^^^^^^^^^^^\n" + |
16675 |
"Type safety: Unchecked invocation allOf(Class) of the generic method allOf(Class<E>) of type EnumSet\n" + |
16680 |
"Type safety: Unchecked invocation allOf(Class) of the generic method allOf(Class<E>) of type EnumSet\n" + |
16676 |
"----------\n" + |
16681 |
"----------\n" + |
16677 |
"5. WARNING in X.java (at line 10)\n" + |
16682 |
"5. WARNING in X.java (at line 10)\n" + |
16678 |
" EnumSet<Enum> eSet = EnumSet.allOf(c);\n" + |
16683 |
" EnumSet<Enum> eSet = EnumSet.allOf(c);\n" + |
16679 |
" ^^^^^^^^^^^^^^^^\n" + |
16684 |
" ^^^^^^^^^^^^^^^^\n" + |
16680 |
"Type safety: The expression of type EnumSet needs unchecked conversion to conform to EnumSet<Enum>\n" + |
16685 |
"Type safety: The expression of type EnumSet needs unchecked conversion to conform to EnumSet<Enum>\n" + |
16681 |
"----------\n" + |
16686 |
"----------\n" + |
16682 |
"6. WARNING in X.java (at line 10)\n" + |
16687 |
"6. WARNING in X.java (at line 10)\n" + |
16683 |
" EnumSet<Enum> eSet = EnumSet.allOf(c);\n" + |
16688 |
" EnumSet<Enum> eSet = EnumSet.allOf(c);\n" + |
16684 |
" ^\n" + |
16689 |
" ^\n" + |
16685 |
"Type safety: The expression of type Class needs unchecked conversion to conform to Class<E>\n" + |
16690 |
"Type safety: The expression of type Class needs unchecked conversion to conform to Class<Enum>\n" + |
16686 |
"----------\n"); |
16691 |
"----------\n"); |
16687 |
} |
16692 |
} |
16688 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=86838 - variation |
16693 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=86838 - variation |
Lines 16729-16735
Link Here
|
16729 |
} |
16734 |
} |
16730 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=86838 - variation |
16735 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=86838 - variation |
16731 |
public void test0536() { |
16736 |
public void test0536() { |
16732 |
this.runConformTest( |
16737 |
this.runNegativeTest( |
16733 |
new String[] { |
16738 |
new String[] { |
16734 |
"X.java", |
16739 |
"X.java", |
16735 |
"import java.util.EnumSet;\n" + |
16740 |
"import java.util.EnumSet;\n" + |
Lines 16741-16751
Link Here
|
16741 |
"public class X {\n" + |
16746 |
"public class X {\n" + |
16742 |
" public static void main(String[] args) {\n" + |
16747 |
" public static void main(String[] args) {\n" + |
16743 |
" Class c = Foo.class;\n" + |
16748 |
" Class c = Foo.class;\n" + |
16744 |
" EnumSet<?> eSet = EnumSet.allOf(c);\n" + |
16749 |
" EnumSet<?> eSet = (EnumSet<?>) EnumSet.allOf(c);\n" + |
16745 |
" }\n" + |
16750 |
" }\n" + |
|
|
16751 |
" Zork z;\n" + |
16746 |
"}\n", |
16752 |
"}\n", |
16747 |
}, |
16753 |
}, |
16748 |
"" |
16754 |
"----------\n" + |
|
|
16755 |
"1. WARNING in X.java (at line 9)\n" + |
16756 |
" Class c = Foo.class;\n" + |
16757 |
" ^^^^^\n" + |
16758 |
"Class is a raw type. References to generic type Class<T> should be parameterized\n" + |
16759 |
"----------\n" + |
16760 |
"2. WARNING in X.java (at line 10)\n" + |
16761 |
" EnumSet<?> eSet = (EnumSet<?>) EnumSet.allOf(c);\n" + |
16762 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
16763 |
"Unnecessary cast from EnumSet to EnumSet<?>\n" + |
16764 |
"----------\n" + |
16765 |
"3. WARNING in X.java (at line 10)\n" + |
16766 |
" EnumSet<?> eSet = (EnumSet<?>) EnumSet.allOf(c);\n" + |
16767 |
" ^^^^^^^^^^^^^^^^\n" + |
16768 |
"Type safety: Unchecked invocation allOf(Class) of the generic method allOf(Class<E>) of type EnumSet\n" + |
16769 |
"----------\n" + |
16770 |
"4. WARNING in X.java (at line 10)\n" + |
16771 |
" EnumSet<?> eSet = (EnumSet<?>) EnumSet.allOf(c);\n" + |
16772 |
" ^\n" + |
16773 |
"Type safety: The expression of type Class needs unchecked conversion to conform to Class<Enum<Enum<E>>>\n" + |
16774 |
"----------\n" + |
16775 |
"5. ERROR in X.java (at line 12)\n" + |
16776 |
" Zork z;\n" + |
16777 |
" ^^^^\n" + |
16778 |
"Zork cannot be resolved to a type\n" + |
16779 |
"----------\n" |
16749 |
); |
16780 |
); |
16750 |
} |
16781 |
} |
16751 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=86838 - variation |
16782 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=86838 - variation |
Lines 16767-16792
Link Here
|
16767 |
" Zork z;\n" + |
16798 |
" Zork z;\n" + |
16768 |
"}\n", |
16799 |
"}\n", |
16769 |
}, |
16800 |
}, |
16770 |
"----------\n" + |
16801 |
"----------\n" + |
16771 |
"1. WARNING in X.java (at line 9)\n" + |
16802 |
"1. WARNING in X.java (at line 9)\n" + |
16772 |
" Class c = Foo.class;\n" + |
16803 |
" Class c = Foo.class;\n" + |
16773 |
" ^^^^^\n" + |
16804 |
" ^^^^^\n" + |
16774 |
"Class is a raw type. References to generic type Class<T> should be parameterized\n" + |
16805 |
"Class is a raw type. References to generic type Class<T> should be parameterized\n" + |
16775 |
"----------\n" + |
16806 |
"----------\n" + |
16776 |
"2. WARNING in X.java (at line 10)\n" + |
16807 |
"2. WARNING in X.java (at line 10)\n" + |
16777 |
" EnumSet<?> eSet = EnumSet.allOf(c);\n" + |
16808 |
" EnumSet<?> eSet = EnumSet.allOf(c);\n" + |
16778 |
" ^^^^^^^^^^^^^^^^\n" + |
16809 |
" ^^^^^^^^^^^^^^^^\n" + |
16779 |
"Type safety: Unchecked invocation allOf(Class) of the generic method allOf(Class<E>) of type EnumSet\n" + |
16810 |
"Type safety: Unchecked invocation allOf(Class) of the generic method allOf(Class<E>) of type EnumSet\n" + |
16780 |
"----------\n" + |
16811 |
"----------\n" + |
16781 |
"3. WARNING in X.java (at line 10)\n" + |
16812 |
"3. WARNING in X.java (at line 10)\n" + |
16782 |
" EnumSet<?> eSet = EnumSet.allOf(c);\n" + |
16813 |
" EnumSet<?> eSet = EnumSet.allOf(c);\n" + |
16783 |
" ^\n" + |
16814 |
" ^\n" + |
16784 |
"Type safety: The expression of type Class needs unchecked conversion to conform to Class<E>\n" + |
16815 |
"Type safety: The expression of type Class needs unchecked conversion to conform to Class<Enum<Enum<E>>>\n" + |
16785 |
"----------\n" + |
16816 |
"----------\n" + |
16786 |
"4. ERROR in X.java (at line 12)\n" + |
16817 |
"4. ERROR in X.java (at line 12)\n" + |
16787 |
" Zork z;\n" + |
16818 |
" Zork z;\n" + |
16788 |
" ^^^^\n" + |
16819 |
" ^^^^\n" + |
16789 |
"Zork cannot be resolved to a type\n" + |
16820 |
"Zork cannot be resolved to a type\n" + |
16790 |
"----------\n"); |
16821 |
"----------\n"); |
16791 |
} |
16822 |
} |
16792 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=86838 - variation |
16823 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=86838 - variation |
Lines 16807-16837
Link Here
|
16807 |
" }\n" + |
16838 |
" }\n" + |
16808 |
"}\n", |
16839 |
"}\n", |
16809 |
}, |
16840 |
}, |
16810 |
"----------\n" + |
16841 |
"----------\n" + |
16811 |
"1. WARNING in X.java (at line 9)\n" + |
16842 |
"1. WARNING in X.java (at line 9)\n" + |
16812 |
" Class c = Foo.class;\n" + |
16843 |
" Class c = Foo.class;\n" + |
16813 |
" ^^^^^\n" + |
16844 |
" ^^^^^\n" + |
16814 |
"Class is a raw type. References to generic type Class<T> should be parameterized\n" + |
16845 |
"Class is a raw type. References to generic type Class<T> should be parameterized\n" + |
16815 |
"----------\n" + |
16846 |
"----------\n" + |
16816 |
"2. ERROR in X.java (at line 10)\n" + |
16847 |
"2. ERROR in X.java (at line 10)\n" + |
16817 |
" EnumSet<Enum<?>> eSet = EnumSet.allOf(c);\n" + |
16848 |
" EnumSet<Enum<?>> eSet = EnumSet.allOf(c);\n" + |
16818 |
" ^^^^\n" + |
16849 |
" ^^^^\n" + |
16819 |
"Bound mismatch: The type Enum<?> is not a valid substitute for the bounded parameter <E extends Enum<E>> of the type EnumSet<E>\n" + |
16850 |
"Bound mismatch: The type Enum<?> is not a valid substitute for the bounded parameter <E extends Enum<E>> of the type EnumSet<E>\n" + |
16820 |
"----------\n" + |
16851 |
"----------\n" + |
16821 |
"3. WARNING in X.java (at line 10)\n" + |
16852 |
"3. WARNING in X.java (at line 10)\n" + |
16822 |
" EnumSet<Enum<?>> eSet = EnumSet.allOf(c);\n" + |
16853 |
" EnumSet<Enum<?>> eSet = EnumSet.allOf(c);\n" + |
16823 |
" ^^^^^^^^^^^^^^^^\n" + |
16854 |
" ^^^^^^^^^^^^^^^^\n" + |
16824 |
"Type safety: Unchecked invocation allOf(Class) of the generic method allOf(Class<E>) of type EnumSet\n" + |
16855 |
"Type safety: Unchecked invocation allOf(Class) of the generic method allOf(Class<E>) of type EnumSet\n" + |
16825 |
"----------\n" + |
16856 |
"----------\n" + |
16826 |
"4. WARNING in X.java (at line 10)\n" + |
16857 |
"4. WARNING in X.java (at line 10)\n" + |
16827 |
" EnumSet<Enum<?>> eSet = EnumSet.allOf(c);\n" + |
16858 |
" EnumSet<Enum<?>> eSet = EnumSet.allOf(c);\n" + |
16828 |
" ^^^^^^^^^^^^^^^^\n" + |
16859 |
" ^^^^^^^^^^^^^^^^\n" + |
16829 |
"Type safety: The expression of type EnumSet needs unchecked conversion to conform to EnumSet<Enum<?>>\n" + |
16860 |
"Type safety: The expression of type EnumSet needs unchecked conversion to conform to EnumSet<Enum<?>>\n" + |
16830 |
"----------\n" + |
16861 |
"----------\n" + |
16831 |
"5. WARNING in X.java (at line 10)\n" + |
16862 |
"5. WARNING in X.java (at line 10)\n" + |
16832 |
" EnumSet<Enum<?>> eSet = EnumSet.allOf(c);\n" + |
16863 |
" EnumSet<Enum<?>> eSet = EnumSet.allOf(c);\n" + |
16833 |
" ^\n" + |
16864 |
" ^\n" + |
16834 |
"Type safety: The expression of type Class needs unchecked conversion to conform to Class<E>\n" + |
16865 |
"Type safety: The expression of type Class needs unchecked conversion to conform to Class<Enum<?>>\n" + |
16835 |
"----------\n"); |
16866 |
"----------\n"); |
16836 |
} |
16867 |
} |
16837 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=86838 - variation |
16868 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=86838 - variation |
Lines 18874-18894
Link Here
|
18874 |
" Zork z;\n" + |
18905 |
" Zork z;\n" + |
18875 |
"}\n", |
18906 |
"}\n", |
18876 |
}, |
18907 |
}, |
18877 |
"----------\n" + |
18908 |
"----------\n" + |
18878 |
"1. WARNING in Ball.java (at line 2)\n" + |
18909 |
"1. WARNING in Ball.java (at line 2)\n" + |
18879 |
" class Ball implements Comparable {\n" + |
18910 |
" class Ball implements Comparable {\n" + |
18880 |
" ^^^^^^^^^^\n" + |
18911 |
" ^^^^^^^^^^\n" + |
18881 |
"Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" + |
18912 |
"Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" + |
18882 |
"----------\n" + |
18913 |
"----------\n" + |
18883 |
"2. WARNING in Ball.java (at line 10)\n" + |
18914 |
"2. WARNING in Ball.java (at line 10)\n" + |
18884 |
" Collections.sort(foo);\n" + |
18915 |
" Collections.sort(foo);\n" + |
18885 |
" ^^^^^^^^^^^^^^^^^^^^^\n" + |
18916 |
" ^^^^^^^^^^^^^^^^^^^^^\n" + |
18886 |
"Type safety: Unchecked invocation sort(List<Ball>) of the generic method sort(List<T>) of type Collections\n" + |
18917 |
"Type safety: Unchecked invocation sort(LinkedList<Ball>) of the generic method sort(List<T>) of type Collections\n" + |
18887 |
"----------\n" + |
18918 |
"----------\n" + |
18888 |
"3. ERROR in Ball.java (at line 12)\n" + |
18919 |
"3. ERROR in Ball.java (at line 12)\n" + |
18889 |
" Zork z;\n" + |
18920 |
" Zork z;\n" + |
18890 |
" ^^^^\n" + |
18921 |
" ^^^^\n" + |
18891 |
"Zork cannot be resolved to a type\n" + |
18922 |
"Zork cannot be resolved to a type\n" + |
18892 |
"----------\n"); |
18923 |
"----------\n"); |
18893 |
} |
18924 |
} |
18894 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=81831 |
18925 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=81831 |
Lines 22751-22786
Link Here
|
22751 |
" Zork z;\n" + |
22782 |
" Zork z;\n" + |
22752 |
"}\n", |
22783 |
"}\n", |
22753 |
}, |
22784 |
}, |
22754 |
"----------\n" + |
22785 |
"----------\n" + |
22755 |
"1. WARNING in X.java (at line 13)\n" + |
22786 |
"1. WARNING in X.java (at line 13)\n" + |
22756 |
" public class ActionImpl<T extends Base> extends Action<T> implements Comparable<ActionImpl> {\n" + |
22787 |
" public class ActionImpl<T extends Base> extends Action<T> implements Comparable<ActionImpl> {\n" + |
22757 |
" ^^^^^^^^^^\n" + |
22788 |
" ^^^^^^^^^^\n" + |
22758 |
"X.ActionImpl is a raw type. References to generic type X.ActionImpl<T> should be parameterized\n" + |
22789 |
"X.ActionImpl is a raw type. References to generic type X.ActionImpl<T> should be parameterized\n" + |
22759 |
"----------\n" + |
22790 |
"----------\n" + |
22760 |
"2. WARNING in X.java (at line 14)\n" + |
22791 |
"2. WARNING in X.java (at line 14)\n" + |
22761 |
" public int compareTo(ActionImpl o) {\n" + |
22792 |
" public int compareTo(ActionImpl o) {\n" + |
22762 |
" ^^^^^^^^^^\n" + |
22793 |
" ^^^^^^^^^^\n" + |
22763 |
"X.ActionImpl is a raw type. References to generic type X.ActionImpl<T> should be parameterized\n" + |
22794 |
"X.ActionImpl is a raw type. References to generic type X.ActionImpl<T> should be parameterized\n" + |
22764 |
"----------\n" + |
22795 |
"----------\n" + |
22765 |
"3. WARNING in X.java (at line 20)\n" + |
22796 |
"3. WARNING in X.java (at line 20)\n" + |
22766 |
" Set<ActionImpl> set = new TreeSet<ActionImpl>();\n" + |
22797 |
" Set<ActionImpl> set = new TreeSet<ActionImpl>();\n" + |
22767 |
" ^^^^^^^^^^\n" + |
22798 |
" ^^^^^^^^^^\n" + |
22768 |
"X.ActionImpl is a raw type. References to generic type X.ActionImpl<T> should be parameterized\n" + |
22799 |
"X.ActionImpl is a raw type. References to generic type X.ActionImpl<T> should be parameterized\n" + |
22769 |
"----------\n" + |
22800 |
"----------\n" + |
22770 |
"4. WARNING in X.java (at line 20)\n" + |
22801 |
"4. WARNING in X.java (at line 20)\n" + |
22771 |
" Set<ActionImpl> set = new TreeSet<ActionImpl>();\n" + |
22802 |
" Set<ActionImpl> set = new TreeSet<ActionImpl>();\n" + |
22772 |
" ^^^^^^^^^^\n" + |
22803 |
" ^^^^^^^^^^\n" + |
22773 |
"X.ActionImpl is a raw type. References to generic type X.ActionImpl<T> should be parameterized\n" + |
22804 |
"X.ActionImpl is a raw type. References to generic type X.ActionImpl<T> should be parameterized\n" + |
22774 |
"----------\n" + |
22805 |
"----------\n" + |
22775 |
"5. WARNING in X.java (at line 21)\n" + |
22806 |
"5. WARNING in X.java (at line 21)\n" + |
22776 |
" Collections.max(set);\n" + |
22807 |
" Collections.max(set);\n" + |
22777 |
" ^^^^^^^^^^^^^^^^^^^^\n" + |
22808 |
" ^^^^^^^^^^^^^^^^^^^^\n" + |
22778 |
"Type safety: Unchecked invocation max(Collection<? extends X.ActionImpl>) of the generic method max(Collection<? extends T>) of type Collections\n" + |
22809 |
"Type safety: Unchecked invocation max(Set<X.ActionImpl>) of the generic method max(Collection<? extends T>) of type Collections\n" + |
22779 |
"----------\n" + |
22810 |
"----------\n" + |
22780 |
"6. ERROR in X.java (at line 23)\n" + |
22811 |
"6. ERROR in X.java (at line 23)\n" + |
22781 |
" Zork z;\n" + |
22812 |
" Zork z;\n" + |
22782 |
" ^^^^\n" + |
22813 |
" ^^^^\n" + |
22783 |
"Zork cannot be resolved to a type\n" + |
22814 |
"Zork cannot be resolved to a type\n" + |
22784 |
"----------\n"); |
22815 |
"----------\n"); |
22785 |
} |
22816 |
} |
22786 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=98364 |
22817 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=98364 |
Lines 27607-27642
Link Here
|
27607 |
"\n" + |
27638 |
"\n" + |
27608 |
"}\n", |
27639 |
"}\n", |
27609 |
}, |
27640 |
}, |
27610 |
"----------\n" + |
27641 |
"----------\n" + |
27611 |
"1. WARNING in X.java (at line 20)\n" + |
27642 |
"1. WARNING in X.java (at line 20)\n" + |
27612 |
" List<List> o = Foo.foo1();\n" + |
27643 |
" List<List> o = Foo.foo1();\n" + |
27613 |
" ^^^^\n" + |
27644 |
" ^^^^\n" + |
27614 |
"List is a raw type. References to generic type List<E> should be parameterized\n" + |
27645 |
"List is a raw type. References to generic type List<E> should be parameterized\n" + |
27615 |
"----------\n" + |
27646 |
"----------\n" + |
27616 |
"2. ERROR in X.java (at line 20)\n" + |
27647 |
"2. ERROR in X.java (at line 20)\n" + |
27617 |
" List<List> o = Foo.foo1();\n" + |
27648 |
" List<List> o = Foo.foo1();\n" + |
27618 |
" ^^^^\n" + |
27649 |
" ^^^^\n" + |
27619 |
"The method foo1() in the type Foo is not applicable for the arguments ()\n" + |
27650 |
"The method foo1() in the type Foo is not applicable for the arguments ()\n" + |
27620 |
"----------\n" + |
27651 |
"----------\n" + |
27621 |
"3. ERROR in X.java (at line 21)\n" + |
27652 |
"3. ERROR in X.java (at line 21)\n" + |
27622 |
" Foo.bar1(o);\n" + |
27653 |
" Foo.bar1(o);\n" + |
27623 |
" ^^^^\n" + |
27654 |
" ^^^^\n" + |
27624 |
"The method bar1(List<List<T>>) in the type Foo is not applicable for the arguments (List<List>)\n" + |
27655 |
"The method bar1(List<List<T>>) in the type Foo is not applicable for the arguments (List<List>)\n" + |
27625 |
"----------\n" + |
27656 |
"----------\n" + |
27626 |
"4. WARNING in X.java (at line 24)\n" + |
27657 |
"4. WARNING in X.java (at line 24)\n" + |
27627 |
" List o = Foo.foo2();\n" + |
27658 |
" List o = Foo.foo2();\n" + |
27628 |
" ^^^^\n" + |
27659 |
" ^^^^\n" + |
27629 |
"List is a raw type. References to generic type List<E> should be parameterized\n" + |
27660 |
"List is a raw type. References to generic type List<E> should be parameterized\n" + |
27630 |
"----------\n" + |
27661 |
"----------\n" + |
27631 |
"5. WARNING in X.java (at line 25)\n" + |
27662 |
"5. WARNING in X.java (at line 25)\n" + |
27632 |
" Foo.bar2(o);\n" + |
27663 |
" Foo.bar2(o);\n" + |
27633 |
" ^^^^^^^^^^^\n" + |
27664 |
" ^^^^^^^^^^^\n" + |
27634 |
"Type safety: Unchecked invocation bar2(List) of the generic method bar2(List<T>) of type Foo\n" + |
27665 |
"Type safety: Unchecked invocation bar2(List) of the generic method bar2(List<T>) of type Foo\n" + |
27635 |
"----------\n" + |
27666 |
"----------\n" + |
27636 |
"6. WARNING in X.java (at line 25)\n" + |
27667 |
"6. WARNING in X.java (at line 25)\n" + |
27637 |
" Foo.bar2(o);\n" + |
27668 |
" Foo.bar2(o);\n" + |
27638 |
" ^\n" + |
27669 |
" ^\n" + |
27639 |
"Type safety: The expression of type List needs unchecked conversion to conform to List<T>\n" + |
27670 |
"Type safety: The expression of type List needs unchecked conversion to conform to List<Runnable>\n" + |
27640 |
"----------\n"); |
27671 |
"----------\n"); |
27641 |
} |
27672 |
} |
27642 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=114365 |
27673 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=114365 |
Lines 28272-28292
Link Here
|
28272 |
" }\n" + |
28303 |
" }\n" + |
28273 |
"}\n" , |
28304 |
"}\n" , |
28274 |
}, |
28305 |
}, |
28275 |
"----------\n" + |
28306 |
"----------\n" + |
28276 |
"1. ERROR in X.java (at line 7)\n" + |
28307 |
"1. ERROR in X.java (at line 7)\n" + |
28277 |
" String s = getClass();\n" + |
28308 |
" String s = getClass();\n" + |
28278 |
" ^^^^^^^^^^\n" + |
28309 |
" ^^^^^^^^^^\n" + |
28279 |
"Type mismatch: cannot convert from Class<capture#1-of ? extends X> to String\n" + |
28310 |
"Type mismatch: cannot convert from Class<capture#1-of ? extends X> to String\n" + |
28280 |
"----------\n" + |
28311 |
"----------\n" + |
28281 |
"2. ERROR in X.java (at line 8)\n" + |
28312 |
"2. ERROR in X.java (at line 8)\n" + |
28282 |
" return (String) getDefault(getClass());\n" + |
28313 |
" return (String) getDefault(getClass());\n" + |
28283 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
28314 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
28284 |
"Cannot cast from capture#2-of ? extends X to String\n" + |
28315 |
"Cannot cast from X to String\n" + |
28285 |
"----------\n" + |
28316 |
"----------\n" + |
28286 |
"3. WARNING in X.java (at line 8)\n" + |
28317 |
"3. WARNING in X.java (at line 8)\n" + |
28287 |
" return (String) getDefault(getClass());\n" + |
28318 |
" return (String) getDefault(getClass());\n" + |
28288 |
" ^^^^^^^^^^^^^^^^^^^^^^\n" + |
28319 |
" ^^^^^^^^^^^^^^^^^^^^^^\n" + |
28289 |
"Type safety: Unchecked invocation getDefault(Class<capture#2-of ? extends X>) of the generic method getDefault(Class<T>) of type X<C>\n" + |
28320 |
"Type safety: Unchecked invocation getDefault(Class<capture#2-of ? extends X>) of the generic method getDefault(Class<T>) of type X<C>\n" + |
28290 |
"----------\n"); |
28321 |
"----------\n"); |
28291 |
} |
28322 |
} |
28292 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=125445 |
28323 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=125445 |
Lines 30043-30073
Link Here
|
30043 |
" }\n" + |
30074 |
" }\n" + |
30044 |
"}\n", |
30075 |
"}\n", |
30045 |
}, |
30076 |
}, |
30046 |
"----------\n" + |
30077 |
"----------\n" + |
30047 |
"1. WARNING in X.java (at line 6)\n" + |
30078 |
"1. WARNING in X.java (at line 6)\n" + |
30048 |
" Class<? extends Enum> enumType = null;\n" + |
30079 |
" Class<? extends Enum> enumType = null;\n" + |
30049 |
" ^^^^\n" + |
30080 |
" ^^^^\n" + |
30050 |
"Enum is a raw type. References to generic type Enum<E> should be parameterized\n" + |
30081 |
"Enum is a raw type. References to generic type Enum<E> should be parameterized\n" + |
30051 |
"----------\n" + |
30082 |
"----------\n" + |
30052 |
"2. WARNING in X.java (at line 7)\n" + |
30083 |
"2. WARNING in X.java (at line 7)\n" + |
30053 |
" final Collection<E> test = allOf(enumType);\n" + |
30084 |
" final Collection<E> test = allOf(enumType);\n" + |
30054 |
" ^^^^^^^^^^^^^^^\n" + |
30085 |
" ^^^^^^^^^^^^^^^\n" + |
30055 |
"Type safety: Unchecked invocation allOf(Class<capture#1-of ? extends Enum>) of the generic method allOf(Class<E>) of type X\n" + |
30086 |
"Type safety: Unchecked invocation allOf(Class<capture#1-of ? extends Enum>) of the generic method allOf(Class<E>) of type X\n" + |
30056 |
"----------\n" + |
30087 |
"----------\n" + |
30057 |
"3. ERROR in X.java (at line 7)\n" + |
30088 |
"3. WARNING in X.java (at line 7)\n" + |
30058 |
" final Collection<E> test = allOf(enumType);\n" + |
30089 |
" final Collection<E> test = allOf(enumType);\n" + |
30059 |
" ^^^^^^^^^^^^^^^\n" + |
30090 |
" ^^^^^^^^^^^^^^^\n" + |
30060 |
"Type mismatch: cannot convert from Collection<capture#1-of ? extends Enum> to Collection<E>\n" + |
30091 |
"Type safety: The expression of type Collection needs unchecked conversion to conform to Collection<E>\n" + |
30061 |
"----------\n" + |
30092 |
"----------\n" + |
30062 |
"4. WARNING in X.java (at line 9)\n" + |
30093 |
"4. WARNING in X.java (at line 9)\n" + |
30063 |
" Collection<? extends Enum> colType = null;\n" + |
30094 |
" Collection<? extends Enum> colType = null;\n" + |
30064 |
" ^^^^\n" + |
30095 |
" ^^^^\n" + |
30065 |
"Enum is a raw type. References to generic type Enum<E> should be parameterized\n" + |
30096 |
"Enum is a raw type. References to generic type Enum<E> should be parameterized\n" + |
30066 |
"----------\n" + |
30097 |
"----------\n" + |
30067 |
"5. ERROR in X.java (at line 10)\n" + |
30098 |
"5. ERROR in X.java (at line 10)\n" + |
30068 |
" final Collection<E> test2 = colType;\n" + |
30099 |
" final Collection<E> test2 = colType;\n" + |
30069 |
" ^^^^^^^\n" + |
30100 |
" ^^^^^^^\n" + |
30070 |
"Type mismatch: cannot convert from Collection<capture#2-of ? extends Enum> to Collection<E>\n" + |
30101 |
"Type mismatch: cannot convert from Collection<capture#2-of ? extends Enum> to Collection<E>\n" + |
30071 |
"----------\n"); |
30102 |
"----------\n"); |
30072 |
} |
30103 |
} |
30073 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=119238 |
30104 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=119238 |
Lines 31106-31126
Link Here
|
31106 |
" Zork z;\n" + |
31137 |
" Zork z;\n" + |
31107 |
"}\n" |
31138 |
"}\n" |
31108 |
}, |
31139 |
}, |
31109 |
"----------\n" + |
31140 |
"----------\n" + |
31110 |
"1. WARNING in X.java (at line 7)\n" + |
31141 |
"1. WARNING in X.java (at line 7)\n" + |
31111 |
" X x = newInstance();\n" + |
31142 |
" X x = newInstance();\n" + |
31112 |
" ^\n" + |
31143 |
" ^\n" + |
31113 |
"X is a raw type. References to generic type X<A> should be parameterized\n" + |
31144 |
"X is a raw type. References to generic type X<A> should be parameterized\n" + |
31114 |
"----------\n" + |
31145 |
"----------\n" + |
31115 |
"2. WARNING in X.java (at line 8)\n" + |
31146 |
"2. ERROR in X.java (at line 7)\n" + |
31116 |
" return new X[] { x };\n" + |
31147 |
" X x = newInstance();\n" + |
31117 |
" ^^^^^^^^^^^^^\n" + |
31148 |
" ^^^^^^^^^^^\n" + |
31118 |
"Type safety: The expression of type X[] needs unchecked conversion to conform to X<String>[]\n" + |
31149 |
"Bound mismatch: The generic method newInstance() of type X<A> is not applicable for the arguments (). The inferred type Comparable<Comparable<B>> is not a valid substitute for the bounded parameter <B extends Comparable<B>>\n" + |
31119 |
"----------\n" + |
31150 |
"----------\n" + |
31120 |
"3. ERROR in X.java (at line 10)\n" + |
31151 |
"3. WARNING in X.java (at line 8)\n" + |
31121 |
" Zork z;\n" + |
31152 |
" return new X[] { x };\n" + |
31122 |
" ^^^^\n" + |
31153 |
" ^^^^^^^^^^^^^\n" + |
31123 |
"Zork cannot be resolved to a type\n" + |
31154 |
"Type safety: The expression of type X[] needs unchecked conversion to conform to X<String>[]\n" + |
|
|
31155 |
"----------\n" + |
31156 |
"4. ERROR in X.java (at line 10)\n" + |
31157 |
" Zork z;\n" + |
31158 |
" ^^^^\n" + |
31159 |
"Zork cannot be resolved to a type\n" + |
31124 |
"----------\n"); |
31160 |
"----------\n"); |
31125 |
} |
31161 |
} |
31126 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=118273 - variation |
31162 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=118273 - variation |
Lines 31163-31169
Link Here
|
31163 |
"5. WARNING in X.java (at line 7)\n" + |
31199 |
"5. WARNING in X.java (at line 7)\n" + |
31164 |
" Comparable c = newInstance2(x);\n" + |
31200 |
" Comparable c = newInstance2(x);\n" + |
31165 |
" ^\n" + |
31201 |
" ^\n" + |
31166 |
"Type safety: The expression of type X needs unchecked conversion to conform to X<B>\n" + |
31202 |
"Type safety: The expression of type X needs unchecked conversion to conform to X<Comparable>\n" + |
31167 |
"----------\n" + |
31203 |
"----------\n" + |
31168 |
"6. ERROR in X.java (at line 9)\n" + |
31204 |
"6. ERROR in X.java (at line 9)\n" + |
31169 |
" Zork z;\n" + |
31205 |
" Zork z;\n" + |
Lines 32482-32507
Link Here
|
32482 |
" }\n" + |
32518 |
" }\n" + |
32483 |
"}", // ================= |
32519 |
"}", // ================= |
32484 |
}, |
32520 |
}, |
32485 |
"----------\n" + |
32521 |
"----------\n" + |
32486 |
"1. WARNING in X.java (at line 9)\n" + |
32522 |
"1. WARNING in X.java (at line 9)\n" + |
32487 |
" Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" + |
32523 |
" Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" + |
32488 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
32524 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
32489 |
"Type safety: Unchecked invocation chain(Iterator...) of the generic method chain(Iterator<E>...) of type X\n" + |
32525 |
"Type safety: Unchecked invocation chain(Iterator[]) of the generic method chain(Iterator<E>...) of type X\n" + |
32490 |
"----------\n" + |
32526 |
"----------\n" + |
32491 |
"2. WARNING in X.java (at line 9)\n" + |
32527 |
"2. WARNING in X.java (at line 9)\n" + |
32492 |
" Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" + |
32528 |
" Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" + |
32493 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
32529 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
32494 |
"Type safety: The expression of type Iterator needs unchecked conversion to conform to Iterator<Number>\n" + |
32530 |
"Type safety: The expression of type Iterator needs unchecked conversion to conform to Iterator<Number>\n" + |
32495 |
"----------\n" + |
32531 |
"----------\n" + |
32496 |
"3. ERROR in X.java (at line 14)\n" + |
32532 |
"3. WARNING in X.java (at line 9)\n" + |
32497 |
" Iterator<Number> it2 = X.chain(l1.iterator(), l2.iterator());\n" + |
32533 |
" Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" + |
32498 |
" ^^^^^\n" + |
32534 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
32499 |
"The method chain(Iterator<E>...) in the type X is not applicable for the arguments (Iterator<Integer>, Iterator<Float>)\n" + |
32535 |
"Type safety: The expression of type Iterator[] needs unchecked conversion to conform to Iterator<Number>[]\n" + |
32500 |
"----------\n" + |
32536 |
"----------\n" + |
32501 |
"4. WARNING in X.java (at line 18)\n" + |
32537 |
"4. ERROR in X.java (at line 14)\n" + |
32502 |
" Iterator<Number> it2 = X.chain(l1.iterator(), l1.iterator());\n" + |
32538 |
" Iterator<Number> it2 = X.chain(l1.iterator(), l2.iterator());\n" + |
32503 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
32539 |
" ^^^^^\n" + |
32504 |
"Type safety : A generic array of Iterator<Integer> is created for a varargs parameter\n" + |
32540 |
"The method chain(Iterator<E>...) in the type X is not applicable for the arguments (Iterator<Integer>, Iterator<Float>)\n" + |
|
|
32541 |
"----------\n" + |
32542 |
"5. WARNING in X.java (at line 18)\n" + |
32543 |
" Iterator<Number> it2 = X.chain(l1.iterator(), l1.iterator());\n" + |
32544 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
32545 |
"Type safety : A generic array of Iterator<Integer> is created for a varargs parameter\n" + |
32505 |
"----------\n"); |
32546 |
"----------\n"); |
32506 |
} |
32547 |
} |
32507 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=144879 |
32548 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=144879 |
Lines 32530-32565
Link Here
|
32530 |
" }\n" + |
32571 |
" }\n" + |
32531 |
"}", // ================= |
32572 |
"}", // ================= |
32532 |
}, |
32573 |
}, |
32533 |
"----------\n" + |
32574 |
"----------\n" + |
32534 |
"1. WARNING in X.java (at line 9)\n" + |
32575 |
"1. WARNING in X.java (at line 9)\n" + |
32535 |
" Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" + |
32576 |
" Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" + |
32536 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
32577 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
32537 |
"Type safety: Unchecked invocation chain(Iterator...) of the generic method chain(Iterator<? extends T>...) of type X\n" + |
32578 |
"Type safety: Unchecked invocation chain(Iterator[]) of the generic method chain(Iterator<? extends T>...) of type X\n" + |
32538 |
"----------\n" + |
32579 |
"----------\n" + |
32539 |
"2. WARNING in X.java (at line 9)\n" + |
32580 |
"2. WARNING in X.java (at line 9)\n" + |
32540 |
" Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" + |
32581 |
" Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" + |
32541 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
32582 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
32542 |
"Type safety: The expression of type Iterator needs unchecked conversion to conform to Iterator<Number>\n" + |
32583 |
"Type safety: The expression of type Iterator needs unchecked conversion to conform to Iterator<Number>\n" + |
32543 |
"----------\n" + |
32584 |
"----------\n" + |
32544 |
"3. WARNING in X.java (at line 14)\n" + |
32585 |
"3. WARNING in X.java (at line 9)\n" + |
32545 |
" Iterator<Number> it2 = X.chain(l1.iterator(), l2.iterator());\n" + |
32586 |
" Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" + |
32546 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
32587 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
32547 |
"Type safety : A generic array of Iterator<? extends Number&Comparable<?>> is created for a varargs parameter\n" + |
32588 |
"Type safety: The expression of type Iterator[] needs unchecked conversion to conform to Iterator<? extends Number>[]\n" + |
32548 |
"----------\n" + |
32589 |
"----------\n" + |
32549 |
"4. ERROR in X.java (at line 14)\n" + |
32590 |
"4. WARNING in X.java (at line 14)\n" + |
32550 |
" Iterator<Number> it2 = X.chain(l1.iterator(), l2.iterator());\n" + |
32591 |
" Iterator<Number> it2 = X.chain(l1.iterator(), l2.iterator());\n" + |
32551 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
32592 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
32552 |
"Type mismatch: cannot convert from Iterator<Number&Comparable<?>> to Iterator<Number>\n" + |
32593 |
"Type safety : A generic array of Iterator<? extends Number&Comparable<?>> is created for a varargs parameter\n" + |
32553 |
"----------\n" + |
32594 |
"----------\n" + |
32554 |
"5. WARNING in X.java (at line 18)\n" + |
32595 |
"5. ERROR in X.java (at line 14)\n" + |
32555 |
" Iterator<Number> it2 = X.chain(l1.iterator(), l1.iterator());\n" + |
32596 |
" Iterator<Number> it2 = X.chain(l1.iterator(), l2.iterator());\n" + |
32556 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
32597 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
32557 |
"Type safety : A generic array of Iterator<? extends Integer> is created for a varargs parameter\n" + |
32598 |
"Type mismatch: cannot convert from Iterator<Number&Comparable<?>> to Iterator<Number>\n" + |
32558 |
"----------\n" + |
32599 |
"----------\n" + |
32559 |
"6. ERROR in X.java (at line 18)\n" + |
32600 |
"6. WARNING in X.java (at line 18)\n" + |
32560 |
" Iterator<Number> it2 = X.chain(l1.iterator(), l1.iterator());\n" + |
32601 |
" Iterator<Number> it2 = X.chain(l1.iterator(), l1.iterator());\n" + |
32561 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
32602 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
32562 |
"Type mismatch: cannot convert from Iterator<Integer> to Iterator<Number>\n" + |
32603 |
"Type safety : A generic array of Iterator<? extends Integer> is created for a varargs parameter\n" + |
|
|
32604 |
"----------\n" + |
32605 |
"7. ERROR in X.java (at line 18)\n" + |
32606 |
" Iterator<Number> it2 = X.chain(l1.iterator(), l1.iterator());\n" + |
32607 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
32608 |
"Type mismatch: cannot convert from Iterator<Integer> to Iterator<Number>\n" + |
32563 |
"----------\n"); |
32609 |
"----------\n"); |
32564 |
} |
32610 |
} |
32565 |
public void test1001() { |
32611 |
public void test1001() { |
Lines 32770-32776
Link Here
|
32770 |
" X x = bar(l, c);\n" + |
32816 |
" X x = bar(l, c);\n" + |
32771 |
" }\n" + |
32817 |
" }\n" + |
32772 |
" <T> T bar(L<T> l, C<? extends T> c) { \n" + |
32818 |
" <T> T bar(L<T> l, C<? extends T> c) { \n" + |
32773 |
" return null;\n" + |
32819 |
" return zork;\n" + |
32774 |
" } \n" + |
32820 |
" } \n" + |
32775 |
"}\n" + |
32821 |
"}\n" + |
32776 |
"class C<E> {}\n" + |
32822 |
"class C<E> {}\n" + |
Lines 32778-32803
Link Here
|
32778 |
"\n" + |
32824 |
"\n" + |
32779 |
"\n", // ================= |
32825 |
"\n", // ================= |
32780 |
}, |
32826 |
}, |
32781 |
"----------\n" + |
32827 |
"----------\n" + |
32782 |
"1. WARNING in X.java (at line 2)\r\n" + |
32828 |
"1. WARNING in X.java (at line 2)\n" + |
32783 |
" void foo(L l, C<? extends X> c) {\r\n" + |
32829 |
" void foo(L l, C<? extends X> c) {\n" + |
32784 |
" ^\n" + |
32830 |
" ^\n" + |
32785 |
"L is a raw type. References to generic type L<E> should be parameterized\n" + |
32831 |
"L is a raw type. References to generic type L<E> should be parameterized\n" + |
32786 |
"----------\n" + |
32832 |
"----------\n" + |
32787 |
"2. WARNING in X.java (at line 3)\r\n" + |
32833 |
"2. WARNING in X.java (at line 3)\n" + |
32788 |
" X x = bar(l, c);\r\n" + |
32834 |
" X x = bar(l, c);\n" + |
32789 |
" ^^^^^^^^^\n" + |
32835 |
" ^^^^^^^^^\n" + |
32790 |
"Type safety: Unchecked invocation bar(L, C) of the generic method bar(L<T>, C<? extends T>) of type X\n" + |
32836 |
"Type safety: Unchecked invocation bar(L, C<capture#1-of ? extends X>) of the generic method bar(L<T>, C<? extends T>) of type X\n" + |
32791 |
"----------\n" + |
32837 |
"----------\n" + |
32792 |
"3. ERROR in X.java (at line 3)\r\n" + |
32838 |
"3. ERROR in X.java (at line 3)\n" + |
32793 |
" X x = bar(l, c);\r\n" + |
32839 |
" X x = bar(l, c);\n" + |
32794 |
" ^^^^^^^^^\n" + |
32840 |
" ^^^^^^^^^\n" + |
32795 |
"Type mismatch: cannot convert from Object to X\n" + |
32841 |
"Type mismatch: cannot convert from Object to X\n" + |
32796 |
"----------\n" + |
32842 |
"----------\n" + |
32797 |
"4. WARNING in X.java (at line 3)\r\n" + |
32843 |
"4. WARNING in X.java (at line 3)\n" + |
32798 |
" X x = bar(l, c);\r\n" + |
32844 |
" X x = bar(l, c);\n" + |
32799 |
" ^\n" + |
32845 |
" ^\n" + |
32800 |
"Type safety: The expression of type L needs unchecked conversion to conform to L<T>\n" + |
32846 |
"Type safety: The expression of type L needs unchecked conversion to conform to L<X>\n" + |
|
|
32847 |
"----------\n" + |
32848 |
"5. ERROR in X.java (at line 6)\n" + |
32849 |
" return zork;\n" + |
32850 |
" ^^^^\n" + |
32851 |
"zork cannot be resolved\n" + |
32801 |
"----------\n", |
32852 |
"----------\n", |
32802 |
JavacTestOptions.EclipseJustification.EclipseBug148061); |
32853 |
JavacTestOptions.EclipseJustification.EclipseBug148061); |
32803 |
} |
32854 |
} |
Lines 32873-32903
Link Here
|
32873 |
" <U> void bar3(Map<String,String> map, U s, Map<U,U> map2) {}\n" + |
32924 |
" <U> void bar3(Map<String,String> map, U s, Map<U,U> map2) {}\n" + |
32874 |
"}\n", // ================= |
32925 |
"}\n", // ================= |
32875 |
}, |
32926 |
}, |
32876 |
"----------\n" + |
32927 |
"----------\n" + |
32877 |
"1. WARNING in X.java (at line 3)\n" + |
32928 |
"1. WARNING in X.java (at line 3)\n" + |
32878 |
" void foo(HashMap map, String s, Map<String,String> map2) {\n" + |
32929 |
" void foo(HashMap map, String s, Map<String,String> map2) {\n" + |
32879 |
" ^^^^^^^\n" + |
32930 |
" ^^^^^^^\n" + |
32880 |
"HashMap is a raw type. References to generic type HashMap<K,V> should be parameterized\n" + |
32931 |
"HashMap is a raw type. References to generic type HashMap<K,V> should be parameterized\n" + |
32881 |
"----------\n" + |
32932 |
"----------\n" + |
32882 |
"2. WARNING in X.java (at line 4)\n" + |
32933 |
"2. WARNING in X.java (at line 4)\n" + |
32883 |
" bar(map, s, map2); //1\n" + |
32934 |
" bar(map, s, map2); //1\n" + |
32884 |
" ^^^^^^^^^^^^^^^^^\n" + |
32935 |
" ^^^^^^^^^^^^^^^^^\n" + |
32885 |
"Type safety: Unchecked invocation bar(Map, Object, Map) of the generic method bar(Map<U,U>, U, Map<U,U>) of type X\n" + |
32936 |
"Type safety: Unchecked invocation bar(HashMap, String, Map<String,String>) of the generic method bar(Map<U,U>, U, Map<U,U>) of type X\n" + |
32886 |
"----------\n" + |
32937 |
"----------\n" + |
32887 |
"3. WARNING in X.java (at line 4)\n" + |
32938 |
"3. WARNING in X.java (at line 4)\n" + |
32888 |
" bar(map, s, map2); //1\n" + |
32939 |
" bar(map, s, map2); //1\n" + |
32889 |
" ^^^\n" + |
32940 |
" ^^^\n" + |
32890 |
"Type safety: The expression of type HashMap needs unchecked conversion to conform to Map<U,U>\n" + |
32941 |
"Type safety: The expression of type HashMap needs unchecked conversion to conform to Map<String,String>\n" + |
32891 |
"----------\n" + |
32942 |
"----------\n" + |
32892 |
"4. WARNING in X.java (at line 6)\n" + |
32943 |
"4. WARNING in X.java (at line 6)\n" + |
32893 |
" bar2(map, s, map2); //3\n" + |
32944 |
" bar2(map, s, map2); //3\n" + |
32894 |
" ^^^\n" + |
32945 |
" ^^^\n" + |
32895 |
"Type safety: The expression of type HashMap needs unchecked conversion to conform to Map<String,String>\n" + |
32946 |
"Type safety: The expression of type HashMap needs unchecked conversion to conform to Map<String,String>\n" + |
32896 |
"----------\n" + |
32947 |
"----------\n" + |
32897 |
"5. WARNING in X.java (at line 7)\n" + |
32948 |
"5. WARNING in X.java (at line 7)\n" + |
32898 |
" bar3(map, s, map2); //4\n" + |
32949 |
" bar3(map, s, map2); //4\n" + |
32899 |
" ^^^\n" + |
32950 |
" ^^^^^^^^^^^^^^^^^^\n" + |
32900 |
"Type safety: The expression of type HashMap needs unchecked conversion to conform to Map<String,String>\n" + |
32951 |
"Type safety: Unchecked invocation bar3(HashMap, String, Map<String,String>) of the generic method bar3(Map<String,String>, U, Map<U,U>) of type X\n" + |
|
|
32952 |
"----------\n" + |
32953 |
"6. WARNING in X.java (at line 7)\n" + |
32954 |
" bar3(map, s, map2); //4\n" + |
32955 |
" ^^^\n" + |
32956 |
"Type safety: The expression of type HashMap needs unchecked conversion to conform to Map<String,String>\n" + |
32901 |
"----------\n"); |
32957 |
"----------\n"); |
32902 |
} |
32958 |
} |
32903 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=148061 - variation |
32959 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=148061 - variation |
Lines 32918-32980
Link Here
|
32918 |
" return null;\n" + |
32974 |
" return null;\n" + |
32919 |
" }\n" + |
32975 |
" }\n" + |
32920 |
" <T> C<T> bar3(L<T> l, C<T> c) {\n" + |
32976 |
" <T> C<T> bar3(L<T> l, C<T> c) {\n" + |
32921 |
" return null;\n" + |
32977 |
" return zork;\n" + |
32922 |
" }\n" + |
32978 |
" }\n" + |
32923 |
"}\n" + |
32979 |
"}\n" + |
32924 |
"\n" + |
32980 |
"\n" + |
32925 |
"class C<E> {}\n" + |
32981 |
"class C<E> {}\n" + |
32926 |
"class L<E> {}\n", // ================= |
32982 |
"class L<E> {}\n", // ================= |
32927 |
}, |
32983 |
}, |
32928 |
"----------\n" + |
32984 |
"----------\n" + |
32929 |
"1. WARNING in X.java (at line 2)\r\n" + |
32985 |
"1. WARNING in X.java (at line 2)\n" + |
32930 |
" void foo(L l, C<X> c) {\r\n" + |
32986 |
" void foo(L l, C<X> c) {\n" + |
32931 |
" ^\n" + |
32987 |
" ^\n" + |
32932 |
"L is a raw type. References to generic type L<E> should be parameterized\n" + |
32988 |
"L is a raw type. References to generic type L<E> should be parameterized\n" + |
32933 |
"----------\n" + |
32989 |
"----------\n" + |
32934 |
"2. WARNING in X.java (at line 3)\r\n" + |
32990 |
"2. WARNING in X.java (at line 3)\n" + |
32935 |
" X x = bar1(l, c);\r\n" + |
32991 |
" X x = bar1(l, c);\n" + |
32936 |
" ^^^^^^^^^^\n" + |
32992 |
" ^^^^^^^^^^\n" + |
32937 |
"Type safety: Unchecked invocation bar1(L, C) of the generic method bar1(L<T>, C<T>) of type X\n" + |
32993 |
"Type safety: Unchecked invocation bar1(L, C<X>) of the generic method bar1(L<T>, C<T>) of type X\n" + |
32938 |
"----------\n" + |
32994 |
"----------\n" + |
32939 |
"3. ERROR in X.java (at line 3)\r\n" + |
32995 |
"3. ERROR in X.java (at line 3)\n" + |
32940 |
" X x = bar1(l, c);\r\n" + |
32996 |
" X x = bar1(l, c);\n" + |
32941 |
" ^^^^^^^^^^\n" + |
32997 |
" ^^^^^^^^^^\n" + |
32942 |
"Type mismatch: cannot convert from Object to X\n" + |
32998 |
"Type mismatch: cannot convert from Object to X\n" + |
32943 |
"----------\n" + |
32999 |
"----------\n" + |
32944 |
"4. WARNING in X.java (at line 3)\r\n" + |
33000 |
"4. WARNING in X.java (at line 3)\n" + |
32945 |
" X x = bar1(l, c);\r\n" + |
33001 |
" X x = bar1(l, c);\n" + |
32946 |
" ^\n" + |
33002 |
" ^\n" + |
32947 |
"Type safety: The expression of type L needs unchecked conversion to conform to L<T>\n" + |
33003 |
"Type safety: The expression of type L needs unchecked conversion to conform to L<X>\n" + |
32948 |
"----------\n" + |
33004 |
"----------\n" + |
32949 |
"5. WARNING in X.java (at line 4)\r\n" + |
33005 |
"5. WARNING in X.java (at line 4)\n" + |
32950 |
" L<X> lx = bar2(l, c);\r\n" + |
33006 |
" L<X> lx = bar2(l, c);\n" + |
32951 |
" ^^^^^^^^^^\n" + |
33007 |
" ^^^^^^^^^^\n" + |
32952 |
"Type safety: Unchecked invocation bar2(L, C) of the generic method bar2(L<T>, C<T>) of type X\n" + |
33008 |
"Type safety: Unchecked invocation bar2(L, C<X>) of the generic method bar2(L<T>, C<T>) of type X\n" + |
32953 |
"----------\n" + |
33009 |
"----------\n" + |
32954 |
"6. WARNING in X.java (at line 4)\r\n" + |
33010 |
"6. WARNING in X.java (at line 4)\n" + |
32955 |
" L<X> lx = bar2(l, c);\r\n" + |
33011 |
" L<X> lx = bar2(l, c);\n" + |
32956 |
" ^^^^^^^^^^\n" + |
33012 |
" ^^^^^^^^^^\n" + |
32957 |
"Type safety: The expression of type L needs unchecked conversion to conform to L<X>\n" + |
33013 |
"Type safety: The expression of type L needs unchecked conversion to conform to L<X>\n" + |
32958 |
"----------\n" + |
33014 |
"----------\n" + |
32959 |
"7. WARNING in X.java (at line 4)\r\n" + |
33015 |
"7. WARNING in X.java (at line 4)\n" + |
32960 |
" L<X> lx = bar2(l, c);\r\n" + |
33016 |
" L<X> lx = bar2(l, c);\n" + |
32961 |
" ^\n" + |
33017 |
" ^\n" + |
32962 |
"Type safety: The expression of type L needs unchecked conversion to conform to L<T>\n" + |
33018 |
"Type safety: The expression of type L needs unchecked conversion to conform to L<X>\n" + |
32963 |
"----------\n" + |
33019 |
"----------\n" + |
32964 |
"8. WARNING in X.java (at line 5)\r\n" + |
33020 |
"8. WARNING in X.java (at line 5)\n" + |
32965 |
" C<X> cx = bar3(l, c);\r\n" + |
33021 |
" C<X> cx = bar3(l, c);\n" + |
32966 |
" ^^^^^^^^^^\n" + |
33022 |
" ^^^^^^^^^^\n" + |
32967 |
"Type safety: Unchecked invocation bar3(L, C) of the generic method bar3(L<T>, C<T>) of type X\n" + |
33023 |
"Type safety: Unchecked invocation bar3(L, C<X>) of the generic method bar3(L<T>, C<T>) of type X\n" + |
32968 |
"----------\n" + |
33024 |
"----------\n" + |
32969 |
"9. WARNING in X.java (at line 5)\r\n" + |
33025 |
"9. WARNING in X.java (at line 5)\n" + |
32970 |
" C<X> cx = bar3(l, c);\r\n" + |
33026 |
" C<X> cx = bar3(l, c);\n" + |
32971 |
" ^^^^^^^^^^\n" + |
33027 |
" ^^^^^^^^^^\n" + |
32972 |
"Type safety: The expression of type C needs unchecked conversion to conform to C<X>\n" + |
33028 |
"Type safety: The expression of type C needs unchecked conversion to conform to C<X>\n" + |
32973 |
"----------\n" + |
33029 |
"----------\n" + |
32974 |
"10. WARNING in X.java (at line 5)\r\n" + |
33030 |
"10. WARNING in X.java (at line 5)\n" + |
32975 |
" C<X> cx = bar3(l, c);\r\n" + |
33031 |
" C<X> cx = bar3(l, c);\n" + |
32976 |
" ^\n" + |
33032 |
" ^\n" + |
32977 |
"Type safety: The expression of type L needs unchecked conversion to conform to L<T>\n" + |
33033 |
"Type safety: The expression of type L needs unchecked conversion to conform to L<X>\n" + |
|
|
33034 |
"----------\n" + |
33035 |
"11. ERROR in X.java (at line 14)\n" + |
33036 |
" return zork;\n" + |
33037 |
" ^^^^\n" + |
33038 |
"zork cannot be resolved\n" + |
32978 |
"----------\n", |
33039 |
"----------\n", |
32979 |
JavacTestOptions.EclipseJustification.EclipseBug148061); |
33040 |
JavacTestOptions.EclipseJustification.EclipseBug148061); |
32980 |
} |
33041 |
} |
Lines 33010-33050
Link Here
|
33010 |
" }\n" + |
33071 |
" }\n" + |
33011 |
"}\n", // ================= |
33072 |
"}\n", // ================= |
33012 |
}, |
33073 |
}, |
33013 |
"----------\n" + |
33074 |
"----------\n" + |
33014 |
"1. WARNING in X.java (at line 14)\r\n" + |
33075 |
"1. WARNING in X.java (at line 14)\n" + |
33015 |
" void foo(List l1, List<X> l2) {\r\n" + |
33076 |
" void foo(List l1, List<X> l2) {\n" + |
33016 |
" ^^^^\n" + |
33077 |
" ^^^^\n" + |
33017 |
"List is a raw type. References to generic type List<E> should be parameterized\n" + |
33078 |
"List is a raw type. References to generic type List<E> should be parameterized\n" + |
33018 |
"----------\n" + |
33079 |
"----------\n" + |
33019 |
"2. WARNING in X.java (at line 15)\r\n" + |
33080 |
"2. WARNING in X.java (at line 15)\n" + |
33020 |
" X x = bar1(l1, l2);\r\n" + |
33081 |
" X x = bar1(l1, l2);\n" + |
33021 |
" ^^^^^^^^^^^^\n" + |
33082 |
" ^^^^^^^^^^^^\n" + |
33022 |
"Type safety: Unchecked invocation bar1(List, List) of the generic method bar1(List<T>, List<T>) of type X\n" + |
33083 |
"Type safety: Unchecked invocation bar1(List, List<X>) of the generic method bar1(List<T>, List<T>) of type X\n" + |
33023 |
"----------\n" + |
33084 |
"----------\n" + |
33024 |
"3. ERROR in X.java (at line 15)\r\n" + |
33085 |
"3. ERROR in X.java (at line 15)\n" + |
33025 |
" X x = bar1(l1, l2);\r\n" + |
33086 |
" X x = bar1(l1, l2);\n" + |
33026 |
" ^^^^^^^^^^^^\n" + |
33087 |
" ^^^^^^^^^^^^\n" + |
33027 |
"Type mismatch: cannot convert from Object to X\n" + |
33088 |
"Type mismatch: cannot convert from Object to X\n" + |
33028 |
"----------\n" + |
33089 |
"----------\n" + |
33029 |
"4. WARNING in X.java (at line 15)\r\n" + |
33090 |
"4. WARNING in X.java (at line 15)\n" + |
33030 |
" X x = bar1(l1, l2);\r\n" + |
33091 |
" X x = bar1(l1, l2);\n" + |
33031 |
" ^^\n" + |
33092 |
" ^^\n" + |
33032 |
"Type safety: The expression of type List needs unchecked conversion to conform to List<T>\n" + |
33093 |
"Type safety: The expression of type List needs unchecked conversion to conform to List<X>\n" + |
33033 |
"----------\n" + |
33094 |
"----------\n" + |
33034 |
"5. WARNING in X.java (at line 17)\r\n" + |
33095 |
"5. WARNING in X.java (at line 17)\n" + |
33035 |
" List<X> lx = bar2(l1, l2);\r\n" + |
33096 |
" List<X> lx = bar2(l1, l2);\n" + |
33036 |
" ^^^^^^^^^^^^\n" + |
33097 |
" ^^^^^^^^^^^^\n" + |
33037 |
"Type safety: Unchecked invocation bar2(List, List) of the generic method bar2(List<T>, List<T>) of type X\n" + |
33098 |
"Type safety: Unchecked invocation bar2(List, List<X>) of the generic method bar2(List<T>, List<T>) of type X\n" + |
33038 |
"----------\n" + |
33099 |
"----------\n" + |
33039 |
"6. WARNING in X.java (at line 17)\r\n" + |
33100 |
"6. WARNING in X.java (at line 17)\n" + |
33040 |
" List<X> lx = bar2(l1, l2);\r\n" + |
33101 |
" List<X> lx = bar2(l1, l2);\n" + |
33041 |
" ^^^^^^^^^^^^\n" + |
33102 |
" ^^^^^^^^^^^^\n" + |
33042 |
"Type safety: The expression of type List needs unchecked conversion to conform to List<X>\n" + |
33103 |
"Type safety: The expression of type List needs unchecked conversion to conform to List<X>\n" + |
33043 |
"----------\n" + |
33104 |
"----------\n" + |
33044 |
"7. WARNING in X.java (at line 17)\r\n" + |
33105 |
"7. WARNING in X.java (at line 17)\n" + |
33045 |
" List<X> lx = bar2(l1, l2);\r\n" + |
33106 |
" List<X> lx = bar2(l1, l2);\n" + |
33046 |
" ^^\n" + |
33107 |
" ^^\n" + |
33047 |
"Type safety: The expression of type List needs unchecked conversion to conform to List<T>\n" + |
33108 |
"Type safety: The expression of type List needs unchecked conversion to conform to List<X>\n" + |
33048 |
"----------\n", |
33109 |
"----------\n", |
33049 |
JavacTestOptions.EclipseJustification.EclipseBug148061); |
33110 |
JavacTestOptions.EclipseJustification.EclipseBug148061); |
33050 |
} |
33111 |
} |
Lines 33063-33103
Link Here
|
33063 |
" <U,V> Map<U,V> bar(List<U> lu, List<V> lv) { return null; }\n" + |
33124 |
" <U,V> Map<U,V> bar(List<U> lu, List<V> lv) { return null; }\n" + |
33064 |
"}\n", // ================= |
33125 |
"}\n", // ================= |
33065 |
}, |
33126 |
}, |
33066 |
"----------\n" + |
33127 |
"----------\n" + |
33067 |
"1. WARNING in X.java (at line 4)\n" + |
33128 |
"1. WARNING in X.java (at line 4)\n" + |
33068 |
" void foo1(List l, List<String> ls) {\n" + |
33129 |
" void foo1(List l, List<String> ls) {\n" + |
33069 |
" ^^^^\n" + |
33130 |
" ^^^^\n" + |
33070 |
"List is a raw type. References to generic type List<E> should be parameterized\n" + |
33131 |
"List is a raw type. References to generic type List<E> should be parameterized\n" + |
33071 |
"----------\n" + |
33132 |
"----------\n" + |
33072 |
"2. WARNING in X.java (at line 5)\n" + |
33133 |
"2. WARNING in X.java (at line 5)\n" + |
33073 |
" Set<Map.Entry<String,String>> mss1 = bar(l, ls).entrySet();\n" + |
33134 |
" Set<Map.Entry<String,String>> mss1 = bar(l, ls).entrySet();\n" + |
33074 |
" ^^^^^^^^^^\n" + |
33135 |
" ^^^^^^^^^^\n" + |
33075 |
"Type safety: Unchecked invocation bar(List, List) of the generic method bar(List<U>, List<V>) of type X\n" + |
33136 |
"Type safety: Unchecked invocation bar(List, List<String>) of the generic method bar(List<U>, List<V>) of type X\n" + |
33076 |
"----------\n" + |
33137 |
"----------\n" + |
33077 |
"3. WARNING in X.java (at line 5)\n" + |
33138 |
"3. WARNING in X.java (at line 5)\n" + |
33078 |
" Set<Map.Entry<String,String>> mss1 = bar(l, ls).entrySet();\n" + |
33139 |
" Set<Map.Entry<String,String>> mss1 = bar(l, ls).entrySet();\n" + |
33079 |
" ^^^^^^^^^^^^^^^^^^^^^\n" + |
33140 |
" ^^^^^^^^^^^^^^^^^^^^^\n" + |
33080 |
"Type safety: The expression of type Set needs unchecked conversion to conform to Set<Map.Entry<String,String>>\n" + |
33141 |
"Type safety: The expression of type Set needs unchecked conversion to conform to Set<Map.Entry<String,String>>\n" + |
33081 |
"----------\n" + |
33142 |
"----------\n" + |
33082 |
"4. WARNING in X.java (at line 5)\n" + |
33143 |
"4. WARNING in X.java (at line 5)\n" + |
33083 |
" Set<Map.Entry<String,String>> mss1 = bar(l, ls).entrySet();\n" + |
33144 |
" Set<Map.Entry<String,String>> mss1 = bar(l, ls).entrySet();\n" + |
33084 |
" ^\n" + |
33145 |
" ^\n" + |
33085 |
"Type safety: The expression of type List needs unchecked conversion to conform to List<U>\n" + |
33146 |
"Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" + |
33086 |
"----------\n" + |
33147 |
"----------\n" + |
33087 |
"5. WARNING in X.java (at line 6)\n" + |
33148 |
"5. WARNING in X.java (at line 6)\n" + |
33088 |
" String s = bar(l, ls).entrySet();\n" + |
33149 |
" String s = bar(l, ls).entrySet();\n" + |
33089 |
" ^^^^^^^^^^\n" + |
33150 |
" ^^^^^^^^^^\n" + |
33090 |
"Type safety: Unchecked invocation bar(List, List) of the generic method bar(List<U>, List<V>) of type X\n" + |
33151 |
"Type safety: Unchecked invocation bar(List, List<String>) of the generic method bar(List<U>, List<V>) of type X\n" + |
33091 |
"----------\n" + |
33152 |
"----------\n" + |
33092 |
"6. ERROR in X.java (at line 6)\n" + |
33153 |
"6. ERROR in X.java (at line 6)\n" + |
33093 |
" String s = bar(l, ls).entrySet();\n" + |
33154 |
" String s = bar(l, ls).entrySet();\n" + |
33094 |
" ^^^^^^^^^^^^^^^^^^^^^\n" + |
33155 |
" ^^^^^^^^^^^^^^^^^^^^^\n" + |
33095 |
"Type mismatch: cannot convert from Set to String\n" + |
33156 |
"Type mismatch: cannot convert from Set to String\n" + |
33096 |
"----------\n" + |
33157 |
"----------\n" + |
33097 |
"7. WARNING in X.java (at line 6)\n" + |
33158 |
"7. WARNING in X.java (at line 6)\n" + |
33098 |
" String s = bar(l, ls).entrySet();\n" + |
33159 |
" String s = bar(l, ls).entrySet();\n" + |
33099 |
" ^\n" + |
33160 |
" ^\n" + |
33100 |
"Type safety: The expression of type List needs unchecked conversion to conform to List<U>\n" + |
33161 |
"Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" + |
33101 |
"----------\n"); |
33162 |
"----------\n"); |
33102 |
} |
33163 |
} |
33103 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=148061 - variation |
33164 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=148061 - variation |
Lines 33114-33154
Link Here
|
33114 |
" <U,V> List<V> bar(List<U> lu, List<V> lv) { return null; }\n" + |
33175 |
" <U,V> List<V> bar(List<U> lu, List<V> lv) { return null; }\n" + |
33115 |
"}\n", // ================= |
33176 |
"}\n", // ================= |
33116 |
}, |
33177 |
}, |
33117 |
"----------\n" + |
33178 |
"----------\n" + |
33118 |
"1. WARNING in X.java (at line 3)\n" + |
33179 |
"1. WARNING in X.java (at line 3)\n" + |
33119 |
" void foo1(List l, List<String> ls) {\n" + |
33180 |
" void foo1(List l, List<String> ls) {\n" + |
33120 |
" ^^^^\n" + |
33181 |
" ^^^^\n" + |
33121 |
"List is a raw type. References to generic type List<E> should be parameterized\n" + |
33182 |
"List is a raw type. References to generic type List<E> should be parameterized\n" + |
33122 |
"----------\n" + |
33183 |
"----------\n" + |
33123 |
"2. WARNING in X.java (at line 4)\n" + |
33184 |
"2. WARNING in X.java (at line 4)\n" + |
33124 |
" List<String> ls1 = bar(l, ls);\n" + |
33185 |
" List<String> ls1 = bar(l, ls);\n" + |
33125 |
" ^^^^^^^^^^\n" + |
33186 |
" ^^^^^^^^^^\n" + |
33126 |
"Type safety: Unchecked invocation bar(List, List) of the generic method bar(List<U>, List<V>) of type X\n" + |
33187 |
"Type safety: Unchecked invocation bar(List, List<String>) of the generic method bar(List<U>, List<V>) of type X\n" + |
33127 |
"----------\n" + |
33188 |
"----------\n" + |
33128 |
"3. WARNING in X.java (at line 4)\n" + |
33189 |
"3. WARNING in X.java (at line 4)\n" + |
33129 |
" List<String> ls1 = bar(l, ls);\n" + |
33190 |
" List<String> ls1 = bar(l, ls);\n" + |
33130 |
" ^^^^^^^^^^\n" + |
33191 |
" ^^^^^^^^^^\n" + |
33131 |
"Type safety: The expression of type List needs unchecked conversion to conform to List<String>\n" + |
33192 |
"Type safety: The expression of type List needs unchecked conversion to conform to List<String>\n" + |
33132 |
"----------\n" + |
33193 |
"----------\n" + |
33133 |
"4. WARNING in X.java (at line 4)\n" + |
33194 |
"4. WARNING in X.java (at line 4)\n" + |
33134 |
" List<String> ls1 = bar(l, ls);\n" + |
33195 |
" List<String> ls1 = bar(l, ls);\n" + |
33135 |
" ^\n" + |
33196 |
" ^\n" + |
33136 |
"Type safety: The expression of type List needs unchecked conversion to conform to List<U>\n" + |
33197 |
"Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" + |
33137 |
"----------\n" + |
33198 |
"----------\n" + |
33138 |
"5. WARNING in X.java (at line 5)\n" + |
33199 |
"5. WARNING in X.java (at line 5)\n" + |
33139 |
" String s = bar(l, ls);\n" + |
33200 |
" String s = bar(l, ls);\n" + |
33140 |
" ^^^^^^^^^^\n" + |
33201 |
" ^^^^^^^^^^\n" + |
33141 |
"Type safety: Unchecked invocation bar(List, List) of the generic method bar(List<U>, List<V>) of type X\n" + |
33202 |
"Type safety: Unchecked invocation bar(List, List<String>) of the generic method bar(List<U>, List<V>) of type X\n" + |
33142 |
"----------\n" + |
33203 |
"----------\n" + |
33143 |
"6. ERROR in X.java (at line 5)\n" + |
33204 |
"6. ERROR in X.java (at line 5)\n" + |
33144 |
" String s = bar(l, ls);\n" + |
33205 |
" String s = bar(l, ls);\n" + |
33145 |
" ^^^^^^^^^^\n" + |
33206 |
" ^^^^^^^^^^\n" + |
33146 |
"Type mismatch: cannot convert from List to String\n" + |
33207 |
"Type mismatch: cannot convert from List to String\n" + |
33147 |
"----------\n" + |
33208 |
"----------\n" + |
33148 |
"7. WARNING in X.java (at line 5)\n" + |
33209 |
"7. WARNING in X.java (at line 5)\n" + |
33149 |
" String s = bar(l, ls);\n" + |
33210 |
" String s = bar(l, ls);\n" + |
33150 |
" ^\n" + |
33211 |
" ^\n" + |
33151 |
"Type safety: The expression of type List needs unchecked conversion to conform to List<U>\n" + |
33212 |
"Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" + |
33152 |
"----------\n"); |
33213 |
"----------\n"); |
33153 |
} |
33214 |
} |
33154 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=148061 - variation |
33215 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=148061 - variation |
Lines 33926-33941
Link Here
|
33926 |
"}", // ================= |
33987 |
"}", // ================= |
33927 |
|
33988 |
|
33928 |
}, |
33989 |
}, |
33929 |
"----------\n" + |
33990 |
"----------\n" + |
33930 |
"1. WARNING in ComparableComparator.java (at line 14)\n" + |
33991 |
"1. WARNING in ComparableComparator.java (at line 14)\n" + |
33931 |
" static <M extends String> Comparator<M> baz() {\n" + |
33992 |
" static <M extends String> Comparator<M> baz() {\n" + |
33932 |
" ^^^^^^\n" + |
33993 |
" ^^^^^^\n" + |
33933 |
"The type parameter M should not be bounded by the final type String. Final types cannot be further extended\n" + |
33994 |
"The type parameter M should not be bounded by the final type String. Final types cannot be further extended\n" + |
33934 |
"----------\n" + |
33995 |
"----------\n" + |
33935 |
"2. ERROR in ComparableComparator.java (at line 27)\n" + |
33996 |
"2. ERROR in ComparableComparator.java (at line 25)\n" + |
33936 |
" static Object BAR2 = ComparableComparator.bar();//1a\n" + |
33997 |
" static Comparator BAR = ComparableComparator.bar();//0\n" + |
33937 |
" ^^^\n" + |
33998 |
" ^^^\n" + |
33938 |
"Bound mismatch: The generic method bar() of type ComparableComparator<T> is not applicable for the arguments (). The inferred type Comparable<Comparable<M>> is not a valid substitute for the bounded parameter <M extends Comparable<M>>\n" + |
33999 |
"Bound mismatch: The generic method bar() of type ComparableComparator<T> is not applicable for the arguments (). The inferred type Comparable<Comparable<M>> is not a valid substitute for the bounded parameter <M extends Comparable<M>>\n" + |
|
|
34000 |
"----------\n" + |
34001 |
"3. ERROR in ComparableComparator.java (at line 27)\n" + |
34002 |
" static Object BAR2 = ComparableComparator.bar();//1a\n" + |
34003 |
" ^^^\n" + |
34004 |
"Bound mismatch: The generic method bar() of type ComparableComparator<T> is not applicable for the arguments (). The inferred type Comparable<Comparable<M>> is not a valid substitute for the bounded parameter <M extends Comparable<M>>\n" + |
33939 |
"----------\n"); |
34005 |
"----------\n"); |
33940 |
} |
34006 |
} |
33941 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=158548 |
34007 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=158548 |
Lines 44592-44598
Link Here
|
44592 |
"----------\n"); |
44658 |
"----------\n"); |
44593 |
} |
44659 |
} |
44594 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=231094 |
44660 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=231094 |
44595 |
public void _test1322() { |
44661 |
public void test1322() { |
44596 |
this.runNegativeTest( |
44662 |
this.runNegativeTest( |
44597 |
new String[] { |
44663 |
new String[] { |
44598 |
"X.java", // ================= |
44664 |
"X.java", // ================= |
Lines 44620-44654
Link Here
|
44620 |
"class Bob2 extends Bob {}\n" + |
44686 |
"class Bob2 extends Bob {}\n" + |
44621 |
"class Thingy<T extends Bob> {}\n", // ================= |
44687 |
"class Thingy<T extends Bob> {}\n", // ================= |
44622 |
}, |
44688 |
}, |
44623 |
"----------\n" + |
44689 |
"----------\n" + |
44624 |
"1. WARNING in X.java (at line 6)\n" + |
44690 |
"1. WARNING in X.java (at line 6)\n" + |
44625 |
" x.doStuff(Bob.class, new Thingy());\n" + |
44691 |
" x.doStuff(Bob.class, new Thingy());\n" + |
44626 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
44692 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
44627 |
"Type safety: Unchecked invocation doStuff(Class, Thingy) of the generic method doStuff(Class<T>, Thingy<T>) of type X\n" + |
44693 |
"Type safety: Unchecked invocation doStuff(Class<Bob>, Thingy) of the generic method doStuff(Class<T>, Thingy<T>) of type X\n" + |
44628 |
"----------\n" + |
44694 |
"----------\n" + |
44629 |
"2. WARNING in X.java (at line 6)\n" + |
44695 |
"2. WARNING in X.java (at line 6)\n" + |
44630 |
" x.doStuff(Bob.class, new Thingy());\n" + |
44696 |
" x.doStuff(Bob.class, new Thingy());\n" + |
44631 |
" ^^^^^^^^^^^^\n" + |
44697 |
" ^^^^^^^^^^^^\n" + |
44632 |
"Type safety: The expression of type Thingy needs unchecked conversion to conform to Thingy<T>\n" + |
44698 |
"Type safety: The expression of type Thingy needs unchecked conversion to conform to Thingy<Bob>\n" + |
44633 |
"----------\n" + |
44699 |
"----------\n" + |
44634 |
"3. WARNING in X.java (at line 6)\n" + |
44700 |
"3. WARNING in X.java (at line 6)\n" + |
44635 |
" x.doStuff(Bob.class, new Thingy());\n" + |
44701 |
" x.doStuff(Bob.class, new Thingy());\n" + |
44636 |
" ^^^^^^\n" + |
44702 |
" ^^^^^^\n" + |
44637 |
"Thingy is a raw type. References to generic type Thingy<T> should be parameterized\n" + |
44703 |
"Thingy is a raw type. References to generic type Thingy<T> should be parameterized\n" + |
44638 |
"----------\n" + |
44704 |
"----------\n" + |
44639 |
"4. ERROR in X.java (at line 15)\n" + |
44705 |
"4. ERROR in X.java (at line 15)\n" + |
44640 |
" x.doStuff(Jim.class, new Thingy());\n" + |
44706 |
" x.doStuff(Jim.class, new Thingy());\n" + |
44641 |
" ^^^^^^^\n" + |
44707 |
" ^^^^^^^\n" + |
44642 |
"Bound mismatch: The generic method doStuff(Class<T>, Thingy<T>) of type X is not applicable for the arguments (Class<Jim>, Thingy). The inferred type Jim is not a valid substitute for the bounded parameter <T extends Bob>\n" + |
44708 |
"Bound mismatch: The generic method doStuff(Class<T>, Thingy<T>) of type X is not applicable for the arguments (Class<Jim>, Thingy). The inferred type Jim is not a valid substitute for the bounded parameter <T extends Bob>\n" + |
44643 |
"----------\n" + |
44709 |
"----------\n" + |
44644 |
"5. WARNING in X.java (at line 15)\n" + |
44710 |
"5. WARNING in X.java (at line 15)\n" + |
44645 |
" x.doStuff(Jim.class, new Thingy());\n" + |
44711 |
" x.doStuff(Jim.class, new Thingy());\n" + |
44646 |
" ^^^^^^\n" + |
44712 |
" ^^^^^^\n" + |
44647 |
"Thingy is a raw type. References to generic type Thingy<T> should be parameterized\n" + |
44713 |
"Thingy is a raw type. References to generic type Thingy<T> should be parameterized\n" + |
44648 |
"----------\n"); |
44714 |
"----------\n"); |
44649 |
} |
44715 |
} |
44650 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=231094 - variation |
44716 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=231094 - variation |
44651 |
public void _test1323() { |
44717 |
public void test1323() { |
44652 |
this.runNegativeTest( |
44718 |
this.runNegativeTest( |
44653 |
new String[] { |
44719 |
new String[] { |
44654 |
"X.java", // ================= |
44720 |
"X.java", // ================= |
Lines 44665-44704
Link Here
|
44665 |
"class Bob2 extends Bob {}\n" + |
44731 |
"class Bob2 extends Bob {}\n" + |
44666 |
"class Thingy<T extends Bob> {}\n", // ================= |
44732 |
"class Thingy<T extends Bob> {}\n", // ================= |
44667 |
}, |
44733 |
}, |
44668 |
"----------\n" + |
44734 |
"----------\n" + |
44669 |
"1. ERROR in X.java (at line 4)\n" + |
44735 |
"1. ERROR in X.java (at line 4)\n" + |
44670 |
" x.doStuff2(Jim.class, new Thingy());\n" + |
44736 |
" x.doStuff2(Jim.class, new Thingy());\n" + |
44671 |
" ^^^^^^^^\n" + |
44737 |
" ^^^^^^^^\n" + |
44672 |
"Bound mismatch: The generic method doStuff2(Class<T>, Thingy<U>) of type X is not applicable for the arguments (Class<Jim>, Thingy). The inferred type Jim is not a valid substitute for the bounded parameter <T extends Bob>\n" + |
44738 |
"Bound mismatch: The generic method doStuff2(Class<T>, Thingy<U>) of type X is not applicable for the arguments (Class<Jim>, Thingy). The inferred type Jim is not a valid substitute for the bounded parameter <T extends Bob>\n" + |
44673 |
"----------\n" + |
44739 |
"----------\n" + |
44674 |
"2. WARNING in X.java (at line 4)\n" + |
44740 |
"2. WARNING in X.java (at line 4)\n" + |
44675 |
" x.doStuff2(Jim.class, new Thingy());\n" + |
44741 |
" x.doStuff2(Jim.class, new Thingy());\n" + |
44676 |
" ^^^^^^\n" + |
44742 |
" ^^^^^^\n" + |
44677 |
"Thingy is a raw type. References to generic type Thingy<T> should be parameterized\n" + |
44743 |
"Thingy is a raw type. References to generic type Thingy<T> should be parameterized\n" + |
44678 |
"----------\n" + |
44744 |
"----------\n" + |
44679 |
"3. WARNING in X.java (at line 5)\n" + |
44745 |
"3. WARNING in X.java (at line 5)\n" + |
44680 |
" String s = x.doStuff2(Bob2.class, new Thingy());\n" + |
44746 |
" String s = x.doStuff2(Bob2.class, new Thingy());\n" + |
44681 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
44747 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
44682 |
"Type safety: Unchecked invocation doStuff2(Class<Bob2>, Thingy<Bob>) of the generic method doStuff2(Class<T>, Thingy<U>) of type X\n" + |
44748 |
"Type safety: Unchecked invocation doStuff2(Class<Bob2>, Thingy) of the generic method doStuff2(Class<T>, Thingy<U>) of type X\n" + |
44683 |
"----------\n" + |
44749 |
"----------\n" + |
44684 |
"4. ERROR in X.java (at line 5)\n" + |
44750 |
"4. ERROR in X.java (at line 5)\n" + |
44685 |
" String s = x.doStuff2(Bob2.class, new Thingy());\n" + |
44751 |
" String s = x.doStuff2(Bob2.class, new Thingy());\n" + |
44686 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
44752 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
44687 |
"Type mismatch: cannot convert from Bob2 to String\n" + |
44753 |
"Type mismatch: cannot convert from Bob to String\n" + |
44688 |
"----------\n" + |
44754 |
"----------\n" + |
44689 |
"5. WARNING in X.java (at line 5)\n" + |
44755 |
"5. WARNING in X.java (at line 5)\n" + |
44690 |
" String s = x.doStuff2(Bob2.class, new Thingy());\n" + |
44756 |
" String s = x.doStuff2(Bob2.class, new Thingy());\n" + |
44691 |
" ^^^^^^^^^^^^\n" + |
44757 |
" ^^^^^^^^^^^^\n" + |
44692 |
"Type safety: The expression of type Thingy needs unchecked conversion to conform to Thingy<U>\n" + |
44758 |
"Type safety: The expression of type Thingy needs unchecked conversion to conform to Thingy<Bob>\n" + |
44693 |
"----------\n" + |
44759 |
"----------\n" + |
44694 |
"6. WARNING in X.java (at line 5)\n" + |
44760 |
"6. WARNING in X.java (at line 5)\n" + |
44695 |
" String s = x.doStuff2(Bob2.class, new Thingy());\n" + |
44761 |
" String s = x.doStuff2(Bob2.class, new Thingy());\n" + |
44696 |
" ^^^^^^\n" + |
44762 |
" ^^^^^^\n" + |
44697 |
"Thingy is a raw type. References to generic type Thingy<T> should be parameterized\n" + |
44763 |
"Thingy is a raw type. References to generic type Thingy<T> should be parameterized\n" + |
44698 |
"----------\n"); |
44764 |
"----------\n"); |
44699 |
} |
44765 |
} |
44700 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=231094 - variation |
44766 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=231094 - variation |
44701 |
public void _test1324() { |
44767 |
public void test1324() { |
44702 |
this.runNegativeTest( |
44768 |
this.runNegativeTest( |
44703 |
new String[] { |
44769 |
new String[] { |
44704 |
"X.java", // ================= |
44770 |
"X.java", // ================= |
Lines 44717-44742
Link Here
|
44717 |
"class Bob {}\n" + |
44783 |
"class Bob {}\n" + |
44718 |
"class Thingy<T extends Bob> {}\n", // ================= |
44784 |
"class Thingy<T extends Bob> {}\n", // ================= |
44719 |
}, |
44785 |
}, |
44720 |
"----------\n" + |
44786 |
"----------\n" + |
44721 |
"1. WARNING in X.java (at line 6)\n" + |
44787 |
"1. WARNING in X.java (at line 6)\n" + |
44722 |
" x.doStuff(Bob.class, new Thingy());\n" + |
44788 |
" x.doStuff(Bob.class, new Thingy());\n" + |
44723 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
44789 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
44724 |
"Type safety: Unchecked invocation doStuff(Class<Bob>, Thingy<Bob>) of the generic method doStuff(Class<T>, Thingy<T>) of type X\n" + |
44790 |
"Type safety: Unchecked invocation doStuff(Class<Bob>, Thingy) of the generic method doStuff(Class<T>, Thingy<T>) of type X\n" + |
44725 |
"----------\n" + |
44791 |
"----------\n" + |
44726 |
"2. WARNING in X.java (at line 6)\n" + |
44792 |
"2. WARNING in X.java (at line 6)\n" + |
44727 |
" x.doStuff(Bob.class, new Thingy());\n" + |
44793 |
" x.doStuff(Bob.class, new Thingy());\n" + |
44728 |
" ^^^^^^^^^^^^\n" + |
44794 |
" ^^^^^^^^^^^^\n" + |
44729 |
"Type safety: The expression of type Thingy needs unchecked conversion to conform to Thingy<T>\n" + |
44795 |
"Type safety: The expression of type Thingy needs unchecked conversion to conform to Thingy<Bob>\n" + |
44730 |
"----------\n" + |
44796 |
"----------\n" + |
44731 |
"3. WARNING in X.java (at line 6)\n" + |
44797 |
"3. WARNING in X.java (at line 6)\n" + |
44732 |
" x.doStuff(Bob.class, new Thingy());\n" + |
44798 |
" x.doStuff(Bob.class, new Thingy());\n" + |
44733 |
" ^^^^^^\n" + |
44799 |
" ^^^^^^\n" + |
44734 |
"Thingy is a raw type. References to generic type Thingy<T> should be parameterized\n" + |
44800 |
"Thingy is a raw type. References to generic type Thingy<T> should be parameterized\n" + |
44735 |
"----------\n" + |
44801 |
"----------\n" + |
44736 |
"4. ERROR in X.java (at line 8)\n" + |
44802 |
"4. ERROR in X.java (at line 8)\n" + |
44737 |
" Zork z;\n" + |
44803 |
" Zork z;\n" + |
44738 |
" ^^^^\n" + |
44804 |
" ^^^^\n" + |
44739 |
"Zork cannot be resolved to a type\n" + |
44805 |
"Zork cannot be resolved to a type\n" + |
44740 |
"----------\n"); |
44806 |
"----------\n"); |
44741 |
} |
44807 |
} |
44742 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=231094 - variation |
44808 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=231094 - variation |
Lines 44753-44782
Link Here
|
44753 |
" }\n" + |
44819 |
" }\n" + |
44754 |
"}\n", // ================= |
44820 |
"}\n", // ================= |
44755 |
}, |
44821 |
}, |
44756 |
"----------\n" + |
44822 |
"----------\n" + |
44757 |
"1. WARNING in X.java (at line 5)\n" + |
44823 |
"1. WARNING in X.java (at line 5)\n" + |
44758 |
" void bar(X x) {\n" + |
44824 |
" void bar(X x) {\n" + |
44759 |
" ^\n" + |
44825 |
" ^\n" + |
44760 |
"X is a raw type. References to generic type X<E> should be parameterized\n" + |
44826 |
"X is a raw type. References to generic type X<E> should be parameterized\n" + |
44761 |
"----------\n" + |
44827 |
"----------\n" + |
44762 |
"2. WARNING in X.java (at line 6)\n" + |
44828 |
"2. WARNING in X.java (at line 6)\n" + |
44763 |
" X<String> xs2 = foo(x);\n" + |
44829 |
" X<String> xs2 = foo(x);\n" + |
44764 |
" ^^^^^^\n" + |
44830 |
" ^^^^^^\n" + |
44765 |
"Type safety: Unchecked invocation foo(X) of the generic method foo(X<T>) of type X<E>\n" + |
44831 |
"Type safety: Unchecked invocation foo(X) of the generic method foo(X<T>) of type X<E>\n" + |
44766 |
"----------\n" + |
44832 |
"----------\n" + |
44767 |
"3. ERROR in X.java (at line 6)\n" + |
44833 |
"3. ERROR in X.java (at line 6)\n" + |
44768 |
" X<String> xs2 = foo(x);\n" + |
44834 |
" X<String> xs2 = foo(x);\n" + |
44769 |
" ^^^^^^\n" + |
44835 |
" ^^^^^^\n" + |
44770 |
"Type mismatch: cannot convert from Object to X<String>\n" + |
44836 |
"Type mismatch: cannot convert from Object to X<String>\n" + |
44771 |
"----------\n" + |
44837 |
"----------\n" + |
44772 |
"4. WARNING in X.java (at line 6)\n" + |
44838 |
"4. WARNING in X.java (at line 6)\n" + |
44773 |
" X<String> xs2 = foo(x);\n" + |
44839 |
" X<String> xs2 = foo(x);\n" + |
44774 |
" ^\n" + |
44840 |
" ^\n" + |
44775 |
"Type safety: The expression of type X needs unchecked conversion to conform to X<T>\n" + |
44841 |
"Type safety: The expression of type X needs unchecked conversion to conform to X<Object>\n" + |
44776 |
"----------\n"); |
44842 |
"----------\n"); |
44777 |
} |
44843 |
} |
44778 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=231094 - variation |
44844 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=231094 - variation |
44779 |
public void _test1326() { |
44845 |
public void test1326() { |
44780 |
this.runNegativeTest( |
44846 |
this.runNegativeTest( |
44781 |
new String[] { |
44847 |
new String[] { |
44782 |
"X.java", // ================= |
44848 |
"X.java", // ================= |
Lines 44830-44836
Link Here
|
44830 |
"2. WARNING in X.java (at line 9)\n" + |
44896 |
"2. WARNING in X.java (at line 9)\n" + |
44831 |
" X<String> xs2 = foo(x, xs).identity();\n" + |
44897 |
" X<String> xs2 = foo(x, xs).identity();\n" + |
44832 |
" ^^^^^^^^^^\n" + |
44898 |
" ^^^^^^^^^^\n" + |
44833 |
"Type safety: Unchecked invocation foo(X, X) of the generic method foo(X<T>, X<U>) of type X<E>\n" + |
44899 |
"Type safety: Unchecked invocation foo(X, X<String>) of the generic method foo(X<T>, X<U>) of type X<E>\n" + |
44834 |
"----------\n" + |
44900 |
"----------\n" + |
44835 |
"3. WARNING in X.java (at line 9)\n" + |
44901 |
"3. WARNING in X.java (at line 9)\n" + |
44836 |
" X<String> xs2 = foo(x, xs).identity();\n" + |
44902 |
" X<String> xs2 = foo(x, xs).identity();\n" + |
Lines 44840-44846
Link Here
|
44840 |
"4. WARNING in X.java (at line 9)\n" + |
44906 |
"4. WARNING in X.java (at line 9)\n" + |
44841 |
" X<String> xs2 = foo(x, xs).identity();\n" + |
44907 |
" X<String> xs2 = foo(x, xs).identity();\n" + |
44842 |
" ^\n" + |
44908 |
" ^\n" + |
44843 |
"Type safety: The expression of type X needs unchecked conversion to conform to X<T>\n" + |
44909 |
"Type safety: The expression of type X needs unchecked conversion to conform to X<Object>\n" + |
44844 |
"----------\n"); |
44910 |
"----------\n"); |
44845 |
} |
44911 |
} |
44846 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=231094 - variation |
44912 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=231094 - variation |
Lines 45617-45647
Link Here
|
45617 |
"class Y<S> {}\n" + |
45683 |
"class Y<S> {}\n" + |
45618 |
"class Z { Zork z; }\n", // ================= |
45684 |
"class Z { Zork z; }\n", // ================= |
45619 |
}, |
45685 |
}, |
45620 |
"----------\n" + |
45686 |
"----------\n" + |
45621 |
"1. WARNING in Scratch.java (at line 2)\n" + |
45687 |
"1. WARNING in Scratch.java (at line 2)\n" + |
45622 |
" private Y rawObject = new Y();\n" + |
45688 |
" private Y rawObject = new Y();\n" + |
45623 |
" ^\n" + |
45689 |
" ^\n" + |
45624 |
"Y is a raw type. References to generic type Y<S> should be parameterized\n" + |
45690 |
"Y is a raw type. References to generic type Y<S> should be parameterized\n" + |
45625 |
"----------\n" + |
45691 |
"----------\n" + |
45626 |
"2. WARNING in Scratch.java (at line 2)\n" + |
45692 |
"2. WARNING in Scratch.java (at line 2)\n" + |
45627 |
" private Y rawObject = new Y();\n" + |
45693 |
" private Y rawObject = new Y();\n" + |
45628 |
" ^\n" + |
45694 |
" ^\n" + |
45629 |
"Y is a raw type. References to generic type Y<S> should be parameterized\n" + |
45695 |
"Y is a raw type. References to generic type Y<S> should be parameterized\n" + |
45630 |
"----------\n" + |
45696 |
"----------\n" + |
45631 |
"3. WARNING in Scratch.java (at line 4)\n" + |
45697 |
"3. WARNING in Scratch.java (at line 4)\n" + |
45632 |
" method(new X<Y<Z>>(), rawObject); // compile error in javac, unchecked conversion in Eclipse\n" + |
45698 |
" method(new X<Y<Z>>(), rawObject); // compile error in javac, unchecked conversion in Eclipse\n" + |
45633 |
" ^^^^^^^^^\n" + |
45699 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
45634 |
"Type safety: The expression of type Y needs unchecked conversion to conform to Y<Z>\n" + |
45700 |
"Type safety: Unchecked invocation method(X<Y<Z>>, Y) of the generic method method(X<T>, T) of type Scratch\n" + |
45635 |
"----------\n" + |
45701 |
"----------\n" + |
45636 |
"4. WARNING in Scratch.java (at line 5)\n" + |
45702 |
"4. WARNING in Scratch.java (at line 4)\n" + |
45637 |
" this.<Y<Z>>method(new X<Y<Z>>(), rawObject); // unchecked warning in both\n" + |
45703 |
" method(new X<Y<Z>>(), rawObject); // compile error in javac, unchecked conversion in Eclipse\n" + |
45638 |
" ^^^^^^^^^\n" + |
45704 |
" ^^^^^^^^^\n" + |
45639 |
"Type safety: The expression of type Y needs unchecked conversion to conform to Y<Z>\n" + |
45705 |
"Type safety: The expression of type Y needs unchecked conversion to conform to Y<Z>\n" + |
45640 |
"----------\n" + |
45706 |
"----------\n" + |
45641 |
"5. ERROR in Scratch.java (at line 11)\n" + |
45707 |
"5. WARNING in Scratch.java (at line 5)\n" + |
45642 |
" class Z { Zork z; }\n" + |
45708 |
" this.<Y<Z>>method(new X<Y<Z>>(), rawObject); // unchecked warning in both\n" + |
45643 |
" ^^^^\n" + |
45709 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
45644 |
"Zork cannot be resolved to a type\n" + |
45710 |
"Type safety: Unchecked invocation method(X<Y<Z>>, Y) of the generic method method(X<T>, T) of type Scratch\n" + |
|
|
45711 |
"----------\n" + |
45712 |
"6. WARNING in Scratch.java (at line 5)\n" + |
45713 |
" this.<Y<Z>>method(new X<Y<Z>>(), rawObject); // unchecked warning in both\n" + |
45714 |
" ^^^^^^^^^\n" + |
45715 |
"Type safety: The expression of type Y needs unchecked conversion to conform to Y<Z>\n" + |
45716 |
"----------\n" + |
45717 |
"7. ERROR in Scratch.java (at line 11)\n" + |
45718 |
" class Z { Zork z; }\n" + |
45719 |
" ^^^^\n" + |
45720 |
"Zork cannot be resolved to a type\n" + |
45645 |
"----------\n"); |
45721 |
"----------\n"); |
45646 |
} |
45722 |
} |
45647 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=238484 |
45723 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=238484 |
Lines 47636-47642
Link Here
|
47636 |
"----------\n"); |
47712 |
"----------\n"); |
47637 |
} |
47713 |
} |
47638 |
public void test1406() { |
47714 |
public void test1406() { |
47639 |
this.runConformTest( |
47715 |
this.runNegativeTest( |
47640 |
new String[] { |
47716 |
new String[] { |
47641 |
"GenericTest.java", //----------------------------------------------------------------------- |
47717 |
"GenericTest.java", //----------------------------------------------------------------------- |
47642 |
"import java.util.*;\n" + |
47718 |
"import java.util.*;\n" + |
Lines 47651-47657
Link Here
|
47651 |
" }\n" + |
47727 |
" }\n" + |
47652 |
"}\n",//----------------------------------------------------------------------- |
47728 |
"}\n",//----------------------------------------------------------------------- |
47653 |
}, |
47729 |
}, |
47654 |
""); |
47730 |
"----------\n" + |
|
|
47731 |
"1. WARNING in GenericTest.java (at line 5)\n" + |
47732 |
" Set testList = GenericTest.method1(new Class[] { ArrayList.class });\n" + |
47733 |
" ^^^\n" + |
47734 |
"Set is a raw type. References to generic type Set<E> should be parameterized\n" + |
47735 |
"----------\n" + |
47736 |
"2. WARNING in GenericTest.java (at line 5)\n" + |
47737 |
" Set testList = GenericTest.method1(new Class[] { ArrayList.class });\n" + |
47738 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
47739 |
"Type safety: Unchecked invocation method1(Class[]) of the generic method method1(Class<List>[]) of type GenericTest\n" + |
47740 |
"----------\n" + |
47741 |
"3. ERROR in GenericTest.java (at line 5)\n" + |
47742 |
" Set testList = GenericTest.method1(new Class[] { ArrayList.class });\n" + |
47743 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
47744 |
"Type mismatch: cannot convert from Object to Set\n" + |
47745 |
"----------\n" + |
47746 |
"4. WARNING in GenericTest.java (at line 5)\n" + |
47747 |
" Set testList = GenericTest.method1(new Class[] { ArrayList.class });\n" + |
47748 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
47749 |
"Type safety: The expression of type Class[] needs unchecked conversion to conform to Class<List>[]\n" + |
47750 |
"----------\n" + |
47751 |
"5. WARNING in GenericTest.java (at line 8)\n" + |
47752 |
" public static <I> I method1(Class<List>[] params) {\n" + |
47753 |
" ^^^^\n" + |
47754 |
"List is a raw type. References to generic type List<E> should be parameterized\n" + |
47755 |
"----------\n"); |
47655 |
} |
47756 |
} |
47656 |
public void test1407() { |
47757 |
public void test1407() { |
47657 |
this.runNegativeTest( |
47758 |
this.runNegativeTest( |
Lines 47659-47699
Link Here
|
47659 |
"Foo.java", //----------------------------------------------------------------------- |
47760 |
"Foo.java", //----------------------------------------------------------------------- |
47660 |
"public class Foo {\n" + |
47761 |
"public class Foo {\n" + |
47661 |
" public static <I> I m1(Class<Foo> c) { return null; }\n" + |
47762 |
" public static <I> I m1(Class<Foo> c) { return null; }\n" + |
47662 |
" public static <I> I m2(Class<I> c) { return null; } \n" + |
|
|
47663 |
" void bar() {\n" + |
47763 |
" void bar() {\n" + |
47664 |
" Foo l1 = m1((Class)Foo.class); //ok - unchecked conversion from Class to Class<Foo> - I inferred to be Foo\n" + |
47764 |
" Foo l1 = m1((Class)Foo.class);\n" + |
47665 |
" Foo l2 = m2((Class)Foo.class); //unchecked call, erased return type and error because Object != Foo \n" + |
|
|
47666 |
" }\n" + |
47765 |
" }\n" + |
47667 |
"}\n",//----------------------------------------------------------------------- |
47766 |
"}\n",//----------------------------------------------------------------------- |
47668 |
}, |
47767 |
}, |
47669 |
"----------\n" + |
47768 |
"----------\n" + |
47670 |
"1. WARNING in Foo.java (at line 5)\n" + |
47769 |
"1. WARNING in Foo.java (at line 4)\n" + |
47671 |
" Foo l1 = m1((Class)Foo.class); //ok - unchecked conversion from Class to Class<Foo> - I inferred to be Foo\n" + |
47770 |
" Foo l1 = m1((Class)Foo.class);\n" + |
47672 |
" ^^^^^^^^^^^^^^^^\n" + |
|
|
47673 |
"Type safety: The expression of type Class needs unchecked conversion to conform to Class<Foo>\n" + |
47674 |
"----------\n" + |
47675 |
"2. WARNING in Foo.java (at line 5)\n" + |
47676 |
" Foo l1 = m1((Class)Foo.class); //ok - unchecked conversion from Class to Class<Foo> - I inferred to be Foo\n" + |
47677 |
" ^^^^^\n" + |
47678 |
"Class is a raw type. References to generic type Class<T> should be parameterized\n" + |
47679 |
"----------\n" + |
47680 |
"3. WARNING in Foo.java (at line 6)\n" + |
47681 |
" Foo l2 = m2((Class)Foo.class); //unchecked call, erased return type and error because Object != Foo \n" + |
47682 |
" ^^^^^^^^^^^^^^^^^^^^\n" + |
47771 |
" ^^^^^^^^^^^^^^^^^^^^\n" + |
47683 |
"Type safety: Unchecked invocation m2(Class) of the generic method m2(Class<I>) of type Foo\n" + |
47772 |
"Type safety: Unchecked invocation m1(Class) of the generic method m1(Class<Foo>) of type Foo\n" + |
47684 |
"----------\n" + |
47773 |
"----------\n" + |
47685 |
"4. ERROR in Foo.java (at line 6)\n" + |
47774 |
"2. ERROR in Foo.java (at line 4)\n" + |
47686 |
" Foo l2 = m2((Class)Foo.class); //unchecked call, erased return type and error because Object != Foo \n" + |
47775 |
" Foo l1 = m1((Class)Foo.class);\n" + |
47687 |
" ^^^^^^^^^^^^^^^^^^^^\n" + |
47776 |
" ^^^^^^^^^^^^^^^^^^^^\n" + |
47688 |
"Type mismatch: cannot convert from Object to Foo\n" + |
47777 |
"Type mismatch: cannot convert from Object to Foo\n" + |
47689 |
"----------\n" + |
47778 |
"----------\n" + |
47690 |
"5. WARNING in Foo.java (at line 6)\n" + |
47779 |
"3. WARNING in Foo.java (at line 4)\n" + |
47691 |
" Foo l2 = m2((Class)Foo.class); //unchecked call, erased return type and error because Object != Foo \n" + |
47780 |
" Foo l1 = m1((Class)Foo.class);\n" + |
47692 |
" ^^^^^^^^^^^^^^^^\n" + |
47781 |
" ^^^^^^^^^^^^^^^^\n" + |
47693 |
"Type safety: The expression of type Class needs unchecked conversion to conform to Class<I>\n" + |
47782 |
"Type safety: The expression of type Class needs unchecked conversion to conform to Class<Foo>\n" + |
47694 |
"----------\n" + |
47783 |
"----------\n" + |
47695 |
"6. WARNING in Foo.java (at line 6)\n" + |
47784 |
"4. WARNING in Foo.java (at line 4)\n" + |
47696 |
" Foo l2 = m2((Class)Foo.class); //unchecked call, erased return type and error because Object != Foo \n" + |
47785 |
" Foo l1 = m1((Class)Foo.class);\n" + |
47697 |
" ^^^^^\n" + |
47786 |
" ^^^^^\n" + |
47698 |
"Class is a raw type. References to generic type Class<T> should be parameterized\n" + |
47787 |
"Class is a raw type. References to generic type Class<T> should be parameterized\n" + |
47699 |
"----------\n"); |
47788 |
"----------\n"); |
Lines 48344-48401
Link Here
|
48344 |
}, |
48433 |
}, |
48345 |
""); |
48434 |
""); |
48346 |
} |
48435 |
} |
|
|
48436 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=258798 |
48347 |
public void test1429() { |
48437 |
public void test1429() { |
48348 |
this.runNegativeTest( |
48438 |
this.runNegativeTest( |
48349 |
new String[] { |
48439 |
new String[] { |
48350 |
"X.java", //----------------------------------------------------------------------- |
48440 |
"X.java", //----------------------------------------------------------------------- |
48351 |
"class Foo<T> {}\n" + |
48441 |
"class Foo<T> {}\n" + |
48352 |
"public class X {\n" + |
48442 |
"public class X {\n" + |
48353 |
" public void test() {\n" + |
48443 |
" public void test() {\n" + |
48354 |
" m(new Foo<Foo<Integer>>(), new Foo());\n" + |
48444 |
" Integer i = m(new Foo<Foo<Integer>>(), new Foo());\n" + |
48355 |
" }\n" + |
48445 |
" }\n" + |
48356 |
" public <T> void m(Foo<T> x, T t) {}\n" + |
48446 |
" public <T> T m(Foo<T> x, T t) {\n" + |
|
|
48447 |
" return t;\n" + |
48448 |
" }\n" + |
48357 |
"}\n",//----------------------------------------------------------------------- |
48449 |
"}\n",//----------------------------------------------------------------------- |
48358 |
}, |
48450 |
}, |
48359 |
"----------\n" + |
48451 |
"----------\n" + |
48360 |
"1. WARNING in X.java (at line 4)\n" + |
48452 |
"1. WARNING in X.java (at line 4)\n" + |
48361 |
" m(new Foo<Foo<Integer>>(), new Foo());\n" + |
48453 |
" Integer i = m(new Foo<Foo<Integer>>(), new Foo());\n" + |
48362 |
" ^^^^^^^^^\n" + |
48454 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
|
|
48455 |
"Type safety: Unchecked invocation m(Foo<Foo<Integer>>, Foo) of the generic method m(Foo<T>, T) of type X\n" + |
48456 |
"----------\n" + |
48457 |
"2. ERROR in X.java (at line 4)\n" + |
48458 |
" Integer i = m(new Foo<Foo<Integer>>(), new Foo());\n" + |
48459 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
48460 |
"Type mismatch: cannot convert from Object to Integer\n" + |
48461 |
"----------\n" + |
48462 |
"3. WARNING in X.java (at line 4)\n" + |
48463 |
" Integer i = m(new Foo<Foo<Integer>>(), new Foo());\n" + |
48464 |
" ^^^^^^^^^\n" + |
48363 |
"Type safety: The expression of type Foo needs unchecked conversion to conform to Foo<Integer>\n" + |
48465 |
"Type safety: The expression of type Foo needs unchecked conversion to conform to Foo<Integer>\n" + |
48364 |
"----------\n" + |
48466 |
"----------\n" + |
48365 |
"2. WARNING in X.java (at line 4)\n" + |
48467 |
"4. WARNING in X.java (at line 4)\n" + |
48366 |
" m(new Foo<Foo<Integer>>(), new Foo());\n" + |
48468 |
" Integer i = m(new Foo<Foo<Integer>>(), new Foo());\n" + |
48367 |
" ^^^\n" + |
48469 |
" ^^^\n" + |
48368 |
"Foo is a raw type. References to generic type Foo<T> should be parameterized\n" + |
48470 |
"Foo is a raw type. References to generic type Foo<T> should be parameterized\n" + |
48369 |
"----------\n"); |
48471 |
"----------\n"); |
48370 |
} |
48472 |
} |
|
|
48473 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=258798 - variation |
48371 |
public void test1430() { |
48474 |
public void test1430() { |
48372 |
this.runNegativeTest( |
48475 |
this.runNegativeTest( |
48373 |
new String[] { |
48476 |
new String[] { |
48374 |
"X.java", //----------------------------------------------------------------------- |
48477 |
"X.java", //----------------------------------------------------------------------- |
48375 |
"class Foo<T> {}\n" + |
48478 |
"class Foo<T> {}\n" + |
48376 |
"public class X {\n" + |
48479 |
"public class X {\n" + |
48377 |
" public void test() {\n" + |
48480 |
" public void test() {\n" + |
48378 |
" Integer i = m(new Foo<Foo<Integer>>(), new Foo());\n" + |
48481 |
" m(new Foo<Foo<Integer>>(), new Foo());\n" + |
48379 |
" }\n" + |
48482 |
" }\n" + |
48380 |
" public <T> T m(Foo<T> x, T t) {\n" + |
48483 |
" public <T> void m(Foo<T> x, T t) {}\n" + |
48381 |
" return t;\n" + |
|
|
48382 |
" }\n" + |
48383 |
"}\n",//----------------------------------------------------------------------- |
48484 |
"}\n",//----------------------------------------------------------------------- |
48384 |
}, |
48485 |
}, |
48385 |
"----------\n" + |
48486 |
"----------\n" + |
48386 |
"1. ERROR in X.java (at line 4)\n" + |
48487 |
"1. WARNING in X.java (at line 4)\n" + |
48387 |
" Integer i = m(new Foo<Foo<Integer>>(), new Foo());\n" + |
48488 |
" m(new Foo<Foo<Integer>>(), new Foo());\n" + |
48388 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
48489 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
48389 |
"Type mismatch: cannot convert from Foo<Integer> to Integer\n" + |
48490 |
"Type safety: Unchecked invocation m(Foo<Foo<Integer>>, Foo) of the generic method m(Foo<T>, T) of type X\n" + |
48390 |
"----------\n" + |
48491 |
"----------\n" + |
48391 |
"2. WARNING in X.java (at line 4)\n" + |
48492 |
"2. WARNING in X.java (at line 4)\n" + |
48392 |
" Integer i = m(new Foo<Foo<Integer>>(), new Foo());\n" + |
48493 |
" m(new Foo<Foo<Integer>>(), new Foo());\n" + |
48393 |
" ^^^^^^^^^\n" + |
48494 |
" ^^^^^^^^^\n" + |
48394 |
"Type safety: The expression of type Foo needs unchecked conversion to conform to Foo<Integer>\n" + |
48495 |
"Type safety: The expression of type Foo needs unchecked conversion to conform to Foo<Integer>\n" + |
48395 |
"----------\n" + |
48496 |
"----------\n" + |
48396 |
"3. WARNING in X.java (at line 4)\n" + |
48497 |
"3. WARNING in X.java (at line 4)\n" + |
48397 |
" Integer i = m(new Foo<Foo<Integer>>(), new Foo());\n" + |
48498 |
" m(new Foo<Foo<Integer>>(), new Foo());\n" + |
48398 |
" ^^^\n" + |
48499 |
" ^^^\n" + |
48399 |
"Foo is a raw type. References to generic type Foo<T> should be parameterized\n" + |
48500 |
"Foo is a raw type. References to generic type Foo<T> should be parameterized\n" + |
48400 |
"----------\n"); |
48501 |
"----------\n"); |
48401 |
} |
48502 |
} |
Lines 48439-48442
Link Here
|
48439 |
"----------\n" |
48540 |
"----------\n" |
48440 |
); |
48541 |
); |
48441 |
} |
48542 |
} |
|
|
48543 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=258798 - variation |
48544 |
public void test1432() { |
48545 |
this.runNegativeTest( |
48546 |
new String[] { |
48547 |
"X.java", //----------------------------------------------------------------------- |
48548 |
"class Foo<T> {\n" + |
48549 |
" T bar(Foo<T> ft, T t) {\n" + |
48550 |
" return t;\n" + |
48551 |
" }\n" + |
48552 |
"}\n" + |
48553 |
"public class X {\n" + |
48554 |
" public void test() {\n" + |
48555 |
" Foo<Foo<Integer>> ffi = new Foo<Foo<Integer>>();\n" + |
48556 |
" Integer j = ffi.bar(ffi, new Foo());\n" + |
48557 |
" }\n" + |
48558 |
"}\n",//----------------------------------------------------------------------- |
48559 |
}, |
48560 |
"----------\n" + |
48561 |
"1. ERROR in X.java (at line 9)\n" + |
48562 |
" Integer j = ffi.bar(ffi, new Foo());\n" + |
48563 |
" ^^^^^^^^^^^^^^^^^^^^^^^\n" + |
48564 |
"Type mismatch: cannot convert from Foo<Integer> to Integer\n" + |
48565 |
"----------\n" + |
48566 |
"2. WARNING in X.java (at line 9)\n" + |
48567 |
" Integer j = ffi.bar(ffi, new Foo());\n" + |
48568 |
" ^^^^^^^^^\n" + |
48569 |
"Type safety: The expression of type Foo needs unchecked conversion to conform to Foo<Integer>\n" + |
48570 |
"----------\n" + |
48571 |
"3. WARNING in X.java (at line 9)\n" + |
48572 |
" Integer j = ffi.bar(ffi, new Foo());\n" + |
48573 |
" ^^^\n" + |
48574 |
"Foo is a raw type. References to generic type Foo<T> should be parameterized\n" + |
48575 |
"----------\n"); |
48576 |
} |
48577 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=258798 - variation |
48578 |
public void test1433() { |
48579 |
this.runNegativeTest( |
48580 |
new String[] { |
48581 |
"X.java", //----------------------------------------------------------------------- |
48582 |
"import java.util.*;\n" + |
48583 |
"public class X<T> {\n" + |
48584 |
" Zork z;\n" + |
48585 |
" <U> void foo(X<U> xu) {}\n" + |
48586 |
" void bar(X x) {\n" + |
48587 |
" foo(x);\n" + |
48588 |
" }\n" + |
48589 |
"}\n",//----------------------------------------------------------------------- |
48590 |
}, |
48591 |
"----------\n" + |
48592 |
"1. ERROR in X.java (at line 3)\n" + |
48593 |
" Zork z;\n" + |
48594 |
" ^^^^\n" + |
48595 |
"Zork cannot be resolved to a type\n" + |
48596 |
"----------\n" + |
48597 |
"2. WARNING in X.java (at line 5)\n" + |
48598 |
" void bar(X x) {\n" + |
48599 |
" ^\n" + |
48600 |
"X is a raw type. References to generic type X<T> should be parameterized\n" + |
48601 |
"----------\n" + |
48602 |
"3. WARNING in X.java (at line 6)\n" + |
48603 |
" foo(x);\n" + |
48604 |
" ^^^^^^\n" + |
48605 |
"Type safety: Unchecked invocation foo(X) of the generic method foo(X<U>) of type X<T>\n" + |
48606 |
"----------\n" + |
48607 |
"4. WARNING in X.java (at line 6)\n" + |
48608 |
" foo(x);\n" + |
48609 |
" ^\n" + |
48610 |
"Type safety: The expression of type X needs unchecked conversion to conform to X<Object>\n" + |
48611 |
"----------\n"); |
48612 |
} |
48613 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=258798 - variation |
48614 |
public void test1434() { |
48615 |
this.runNegativeTest( |
48616 |
new String[] { |
48617 |
"Foo.java", //----------------------------------------------------------------------- |
48618 |
"public class Foo {\n" + |
48619 |
" public static <I> I m2(Class<I> c) { return null; } \n" + |
48620 |
" void bar() {\n" + |
48621 |
" Foo l2 = m2((Class)Foo.class);\n" + |
48622 |
" }\n" + |
48623 |
"}\n",//----------------------------------------------------------------------- |
48624 |
}, |
48625 |
"----------\n" + |
48626 |
"1. WARNING in Foo.java (at line 4)\n" + |
48627 |
" Foo l2 = m2((Class)Foo.class);\n" + |
48628 |
" ^^^^^^^^^^^^^^^^^^^^\n" + |
48629 |
"Type safety: Unchecked invocation m2(Class) of the generic method m2(Class<I>) of type Foo\n" + |
48630 |
"----------\n" + |
48631 |
"2. ERROR in Foo.java (at line 4)\n" + |
48632 |
" Foo l2 = m2((Class)Foo.class);\n" + |
48633 |
" ^^^^^^^^^^^^^^^^^^^^\n" + |
48634 |
"Type mismatch: cannot convert from Object to Foo\n" + |
48635 |
"----------\n" + |
48636 |
"3. WARNING in Foo.java (at line 4)\n" + |
48637 |
" Foo l2 = m2((Class)Foo.class);\n" + |
48638 |
" ^^^^^^^^^^^^^^^^\n" + |
48639 |
"Type safety: The expression of type Class needs unchecked conversion to conform to Class<Foo>\n" + |
48640 |
"----------\n" + |
48641 |
"4. WARNING in Foo.java (at line 4)\n" + |
48642 |
" Foo l2 = m2((Class)Foo.class);\n" + |
48643 |
" ^^^^^^^^^^^^^^^^\n" + |
48644 |
"Unnecessary cast from Class<Foo> to Class\n" + |
48645 |
"----------\n" + |
48646 |
"5. WARNING in Foo.java (at line 4)\n" + |
48647 |
" Foo l2 = m2((Class)Foo.class);\n" + |
48648 |
" ^^^^^\n" + |
48649 |
"Class is a raw type. References to generic type Class<T> should be parameterized\n" + |
48650 |
"----------\n"); |
48651 |
} |
48652 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=258798 - variation |
48653 |
public void test1435() { |
48654 |
this.runNegativeTest( |
48655 |
new String[] { |
48656 |
"X.java", //----------------------------------------------------------------------- |
48657 |
"public class X {\n" + |
48658 |
" <T extends Comparable<T>> T min(T x, T y) { return x; }\n" + |
48659 |
" \n" + |
48660 |
" void foo(Foo f, Bar b) {\n" + |
48661 |
" min(f, f);\n" + |
48662 |
" min(b, b);\n" + |
48663 |
" }\n" + |
48664 |
"}\n" + |
48665 |
"abstract class Foo implements Comparable<Foo> {\n" + |
48666 |
"}\n" + |
48667 |
"abstract class Bar extends Foo {}\n",//----------------------------------------------------------------------- |
48668 |
}, |
48669 |
"----------\n" + |
48670 |
"1. ERROR in X.java (at line 6)\n" + |
48671 |
" min(b, b);\n" + |
48672 |
" ^^^\n" + |
48673 |
"Bound mismatch: The generic method min(T, T) of type X is not applicable for the arguments (Bar, Bar). The inferred type Bar is not a valid substitute for the bounded parameter <T extends Comparable<T>>\n" + |
48674 |
"----------\n"); |
48675 |
} |
48676 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=258798 - variation |
48677 |
public void test1436() { |
48678 |
this.runNegativeTest( |
48679 |
new String[] { |
48680 |
"X.java", //----------------------------------------------------------------------- |
48681 |
"import java.util.*;\n" + |
48682 |
"public class X {\n" + |
48683 |
" <U extends List<?>, T extends Throwable> void foo(List<U> lu, T t) throws T {\n" + |
48684 |
" if (lu.isEmpty()) throw t;\n" + |
48685 |
" }\n" + |
48686 |
" void bar(List l, IllegalArgumentException iae) {\n" + |
48687 |
" try {\n" + |
48688 |
" foo(l, iae);\n" + |
48689 |
" } catch (IllegalArgumentException e) {\n" + |
48690 |
" }\n" + |
48691 |
" }\n" + |
48692 |
"}\n",//----------------------------------------------------------------------- |
48693 |
}, |
48694 |
"----------\n" + |
48695 |
"1. WARNING in X.java (at line 6)\n" + |
48696 |
" void bar(List l, IllegalArgumentException iae) {\n" + |
48697 |
" ^^^^\n" + |
48698 |
"List is a raw type. References to generic type List<E> should be parameterized\n" + |
48699 |
"----------\n" + |
48700 |
"2. WARNING in X.java (at line 8)\n" + |
48701 |
" foo(l, iae);\n" + |
48702 |
" ^^^^^^^^^^^\n" + |
48703 |
"Type safety: Unchecked invocation foo(List, IllegalArgumentException) of the generic method foo(List<U>, T) of type X\n" + |
48704 |
"----------\n" + |
48705 |
"3. ERROR in X.java (at line 8)\n" + |
48706 |
" foo(l, iae);\n" + |
48707 |
" ^^^^^^^^^^^\n" + |
48708 |
"Unhandled exception type Throwable\n" + |
48709 |
"----------\n" + |
48710 |
"4. WARNING in X.java (at line 8)\n" + |
48711 |
" foo(l, iae);\n" + |
48712 |
" ^\n" + |
48713 |
"Type safety: The expression of type List needs unchecked conversion to conform to List<List<?>>\n" + |
48714 |
"----------\n"); |
48715 |
} |
48716 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=258798 - variation |
48717 |
public void test1437() { |
48718 |
this.runNegativeTest( |
48719 |
new String[] { |
48720 |
"X.java", //----------------------------------------------------------------------- |
48721 |
"import java.util.*;\n" + |
48722 |
"public class X {\n" + |
48723 |
" <U extends List<?>, T extends Throwable> X(List<U> lu, T t) throws T {\n" + |
48724 |
" if (lu.isEmpty()) throw t;\n" + |
48725 |
" }\n" + |
48726 |
" void bar(List l, IllegalArgumentException iae) {\n" + |
48727 |
" try {\n" + |
48728 |
" new X(l, iae);\n" + |
48729 |
" } catch (IllegalArgumentException e) {\n" + |
48730 |
" }\n" + |
48731 |
" }\n" + |
48732 |
"}\n",//----------------------------------------------------------------------- |
48733 |
}, |
48734 |
"----------\n" + |
48735 |
"1. WARNING in X.java (at line 6)\n" + |
48736 |
" void bar(List l, IllegalArgumentException iae) {\n" + |
48737 |
" ^^^^\n" + |
48738 |
"List is a raw type. References to generic type List<E> should be parameterized\n" + |
48739 |
"----------\n" + |
48740 |
"2. WARNING in X.java (at line 8)\n" + |
48741 |
" new X(l, iae);\n" + |
48742 |
" ^^^^^^^^^^^^^\n" + |
48743 |
"Type safety: Unchecked invocation X(List, IllegalArgumentException) of the generic constructor X(List<U>, T) of type X\n" + |
48744 |
"----------\n" + |
48745 |
"3. ERROR in X.java (at line 8)\n" + |
48746 |
" new X(l, iae);\n" + |
48747 |
" ^^^^^^^^^^^^^\n" + |
48748 |
"Unhandled exception type Throwable\n" + |
48749 |
"----------\n" + |
48750 |
"4. WARNING in X.java (at line 8)\n" + |
48751 |
" new X(l, iae);\n" + |
48752 |
" ^\n" + |
48753 |
"Type safety: The expression of type List needs unchecked conversion to conform to List<List<?>>\n" + |
48754 |
"----------\n"); |
48755 |
} |
48756 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=258798 - variation |
48757 |
public void test1438() { |
48758 |
this.runNegativeTest( |
48759 |
new String[] { |
48760 |
"X.java", //----------------------------------------------------------------------- |
48761 |
"import java.util.*;\n" + |
48762 |
"public class X {\n" + |
48763 |
" <U extends List<?>, T extends Throwable> X(List<U> lu, T t) throws T {\n" + |
48764 |
" if (lu.isEmpty()) throw t;\n" + |
48765 |
" }\n" + |
48766 |
" void bar(List l, IllegalArgumentException iae) {\n" + |
48767 |
" try {\n" + |
48768 |
" new X(l, iae){};\n" + |
48769 |
" } catch (IllegalArgumentException e) {\n" + |
48770 |
" }\n" + |
48771 |
" }\n" + |
48772 |
"}\n",//----------------------------------------------------------------------- |
48773 |
}, |
48774 |
"----------\n" + |
48775 |
"1. WARNING in X.java (at line 6)\n" + |
48776 |
" void bar(List l, IllegalArgumentException iae) {\n" + |
48777 |
" ^^^^\n" + |
48778 |
"List is a raw type. References to generic type List<E> should be parameterized\n" + |
48779 |
"----------\n" + |
48780 |
"2. WARNING in X.java (at line 8)\n" + |
48781 |
" new X(l, iae){};\n" + |
48782 |
" ^^^^^^^^^^^^^^^\n" + |
48783 |
"Type safety: Unchecked invocation X(List, IllegalArgumentException) of the generic constructor X(List<U>, T) of type X\n" + |
48784 |
"----------\n" + |
48785 |
"3. ERROR in X.java (at line 8)\n" + |
48786 |
" new X(l, iae){};\n" + |
48787 |
" ^^^^^^^^^^^^^^^\n" + |
48788 |
"Unhandled exception type Throwable\n" + |
48789 |
"----------\n" + |
48790 |
"4. WARNING in X.java (at line 8)\n" + |
48791 |
" new X(l, iae){};\n" + |
48792 |
" ^\n" + |
48793 |
"Type safety: The expression of type List needs unchecked conversion to conform to List<List<?>>\n" + |
48794 |
"----------\n"); |
48795 |
} |
48796 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=258798 - variation |
48797 |
public void test1439() { |
48798 |
this.runNegativeTest( |
48799 |
new String[] { |
48800 |
"X.java", //----------------------------------------------------------------------- |
48801 |
"import java.util.*;\n" + |
48802 |
"public class X {\n" + |
48803 |
" <U extends List<?>, T extends Throwable> X(List<U> lu, T t) throws T {\n" + |
48804 |
" if (lu.isEmpty()) throw t;\n" + |
48805 |
" }\n" + |
48806 |
" X() { \n" + |
48807 |
" this((List) null, null);\n" + |
48808 |
" }\n" + |
48809 |
"}\n" + |
48810 |
"class Y extends X {\n" + |
48811 |
" <U extends List<?>, T extends Throwable> Y(List<U> lu, T t) {\n" + |
48812 |
" super((List)lu, t);\n" + |
48813 |
" }\n" + |
48814 |
"}\n",//----------------------------------------------------------------------- |
48815 |
}, |
48816 |
"----------\n" + |
48817 |
"1. WARNING in X.java (at line 7)\n" + |
48818 |
" this((List) null, null);\n" + |
48819 |
" ^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
48820 |
"Type safety: Unchecked invocation X(List, null) of the generic constructor X(List<U>, T) of type X\n" + |
48821 |
"----------\n" + |
48822 |
"2. ERROR in X.java (at line 7)\n" + |
48823 |
" this((List) null, null);\n" + |
48824 |
" ^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
48825 |
"Unhandled exception type Throwable\n" + |
48826 |
"----------\n" + |
48827 |
"3. WARNING in X.java (at line 7)\n" + |
48828 |
" this((List) null, null);\n" + |
48829 |
" ^^^^^^^^^^^\n" + |
48830 |
"Type safety: The expression of type List needs unchecked conversion to conform to List<List<?>>\n" + |
48831 |
"----------\n" + |
48832 |
"4. WARNING in X.java (at line 7)\n" + |
48833 |
" this((List) null, null);\n" + |
48834 |
" ^^^^\n" + |
48835 |
"List is a raw type. References to generic type List<E> should be parameterized\n" + |
48836 |
"----------\n" + |
48837 |
"5. WARNING in X.java (at line 12)\n" + |
48838 |
" super((List)lu, t);\n" + |
48839 |
" ^^^^^^^^^^^^^^^^^^^\n" + |
48840 |
"Type safety: Unchecked invocation X(List, T) of the generic constructor X(List<U>, T) of type X\n" + |
48841 |
"----------\n" + |
48842 |
"6. ERROR in X.java (at line 12)\n" + |
48843 |
" super((List)lu, t);\n" + |
48844 |
" ^^^^^^^^^^^^^^^^^^^\n" + |
48845 |
"Unhandled exception type Throwable\n" + |
48846 |
"----------\n" + |
48847 |
"7. WARNING in X.java (at line 12)\n" + |
48848 |
" super((List)lu, t);\n" + |
48849 |
" ^^^^^^^^\n" + |
48850 |
"Type safety: The expression of type List needs unchecked conversion to conform to List<List<?>>\n" + |
48851 |
"----------\n" + |
48852 |
"8. WARNING in X.java (at line 12)\n" + |
48853 |
" super((List)lu, t);\n" + |
48854 |
" ^^^^\n" + |
48855 |
"List is a raw type. References to generic type List<E> should be parameterized\n" + |
48856 |
"----------\n"); |
48857 |
} |
48442 |
} |
48858 |
} |