Failed
org.eclipse.jdt.core.tests.compiler.regression.GenericTypeTest.test1437 - 1.8 (from org.eclipse.jdt.core.tests.compiler.regression.TestAll)
Error Message
test1437 - Eclipse found error(s) but Javac only found warning(s). ----------- Expected ------------ ----------\n 1. WARNING in X.java (at line 6)\n void bar(List l, IllegalArgumentException iae) {\n ^^^^\n List is a raw type. References to generic type List<E> should be parameterized\n ----------\n 2. WARNING in X.java (at line 8)\n new X(l, iae);\n ^^^^^^^^^^^^^\n Type safety: Unchecked invocation X(List, IllegalArgumentException) of the generic constructor X(List<U>, T) of type X\n ----------\n 3. ERROR in X.java (at line 8)\n new X(l, iae);\n ^^^^^^^^^^^^^\n Unhandled exception type Throwable\n ----------\n 4. WARNING in X.java (at line 8)\n new X(l, iae);\n ^\n Type safety: The expression of type List needs unchecked conversion to conform to List<List<?>>\n ----------\n ------------ but was ------------ X.java:6: warning: [rawtypes] found raw type: List\n void bar(List l, IllegalArgumentException iae) {\n ^\n missing type arguments for generic class List<E>\n where E is a type-variable:\n E extends Object declared in interface List\n X.java:8: warning: [unchecked] unchecked method invocation: constructor <init> in class X is applied to given types\n new X(l, iae);\n ^\n required: List<U>,T\n found: List,IllegalArgumentException\n where U,T are type-variables:\n U extends List<?> declared in constructor <U,T>X(List<U>,T)\n T extends Throwable declared in constructor <U,T>X(List<U>,T)\n X.java:8: warning: [unchecked] unchecked conversion\n new X(l, iae);\n ^\n required: List<U>\n found: List\n where U,T are type-variables:\n U extends List<?> declared in constructor <U,T>X(List<U>,T)\n T extends Throwable declared in constructor <U,T>X(List<U>,T)\n 3 warnings\n --------- Difference is ---------- expected:<[----------\n 1. WARNING in X.java (at line 6)\n void bar(List l, IllegalArgumentException iae) {\n ^^^^\n List is a raw type. References to generic type List<E> should be parameterized\n ----------\n 2. WARNING in X.java (at line 8)\n new X(l, iae);\n ^^^^^^^^^^^^^\n Type safety: Unchecked invocation X(List, IllegalArgumentException) of the generic constructor X(List<U>, T) of type X\n ----------\n 3. ERROR in X.java (at line 8)\n new X(l, iae);\n ^^^^^^^^^^^^^\n Unhandled exception type Throwable\n ----------\n 4. WARNING in X.java (at line 8)\n new X(l, iae);\n ^\n Type safety: The expression of type List needs unchecked conversion to conform to List<List<?>>\n ----------]\n > but was:<[X.java:6: warning: [rawtypes] found raw type: List\n void bar(List l, IllegalArgumentException iae) {\n ^\n missing type arguments for generic class List<E>\n where E is a type-variable:\n E extends Object declared in interface List\n X.java:8: warning: [unchecked] unchecked method invocation: constructor <init> in class X is applied to given types\n new X(l, iae);\n ^\n required: List<U>,T\n found: List,IllegalArgumentException\n where U,T are type-variables:\n U extends List<?> declared in constructor <U,T>X(List<U>,T)\n T extends Throwable declared in constructor <U,T>X(List<U>,T)\n X.java:8: warning: [unchecked] unchecked conversion\n new X(l, iae);\n ^\n required: List<U>\n found: List\n where U,T are type-variables:\n U extends List<?> declared in constructor <U,T>X(List<U>,T)\n T extends Throwable declared in constructor <U,T>X(List<U>,T)\n 3 warnings]\n >
Stacktrace
junit.framework.ComparisonFailure: test1437 - Eclipse found error(s) but Javac only found warning(s). ----------- Expected ------------ ----------\n 1. WARNING in X.java (at line 6)\n void bar(List l, IllegalArgumentException iae) {\n ^^^^\n List is a raw type. References to generic type List<E> should be parameterized\n ----------\n 2. WARNING in X.java (at line 8)\n new X(l, iae);\n ^^^^^^^^^^^^^\n Type safety: Unchecked invocation X(List, IllegalArgumentException) of the generic constructor X(List<U>, T) of type X\n ----------\n 3. ERROR in X.java (at line 8)\n new X(l, iae);\n ^^^^^^^^^^^^^\n Unhandled exception type Throwable\n ----------\n 4. WARNING in X.java (at line 8)\n new X(l, iae);\n ^\n Type safety: The expression of type List needs unchecked conversion to conform to List<List<?>>\n ----------\n ------------ but was ------------ X.java:6: warning: [rawtypes] found raw type: List\n void bar(List l, IllegalArgumentException iae) {\n ^\n missing type arguments for generic class List<E>\n where E is a type-variable:\n E extends Object declared in interface List\n X.java:8: warning: [unchecked] unchecked method invocation: constructor <init> in class X is applied to given types\n new X(l, iae);\n ^\n required: List<U>,T\n found: List,IllegalArgumentException\n where U,T are type-variables:\n U extends List<?> declared in constructor <U,T>X(List<U>,T)\n T extends Throwable declared in constructor <U,T>X(List<U>,T)\n X.java:8: warning: [unchecked] unchecked conversion\n new X(l, iae);\n ^\n required: List<U>\n found: List\n where U,T are type-variables:\n U extends List<?> declared in constructor <U,T>X(List<U>,T)\n T extends Throwable declared in constructor <U,T>X(List<U>,T)\n 3 warnings\n --------- Difference is ---------- expected:<[----------\n 1. WARNING in X.java (at line 6)\n void bar(List l, IllegalArgumentException iae) {\n ^^^^\n List is a raw type. References to generic type List<E> should be parameterized\n ----------\n 2. WARNING in X.java (at line 8)\n new X(l, iae);\n ^^^^^^^^^^^^^\n Type safety: Unchecked invocation X(List, IllegalArgumentException) of the generic constructor X(List<U>, T) of type X\n ----------\n 3. ERROR in X.java (at line 8)\n new X(l, iae);\n ^^^^^^^^^^^^^\n Unhandled exception type Throwable\n ----------\n 4. WARNING in X.java (at line 8)\n new X(l, iae);\n ^\n Type safety: The expression of type List needs unchecked conversion to conform to List<List<?>>\n ----------]\n > but was:<[X.java:6: warning: [rawtypes] found raw type: List\n void bar(List l, IllegalArgumentException iae) {\n ^\n missing type arguments for generic class List<E>\n where E is a type-variable:\n E extends Object declared in interface List\n X.java:8: warning: [unchecked] unchecked method invocation: constructor <init> in class X is applied to given types\n new X(l, iae);\n ^\n required: List<U>,T\n found: List,IllegalArgumentException\n where U,T are type-variables:\n U extends List<?> declared in constructor <U,T>X(List<U>,T)\n T extends Throwable declared in constructor <U,T>X(List<U>,T)\n X.java:8: warning: [unchecked] unchecked conversion\n new X(l, iae);\n ^\n required: List<U>\n found: List\n where U,T are type-variables:\n U extends List<?> declared in constructor <U,T>X(List<U>,T)\n T extends Throwable declared in constructor <U,T>X(List<U>,T)\n 3 warnings]\n > at org.eclipse.jdt.core.tests.compiler.regression.GenericTypeTest.test1437(GenericTypeTest.java:50534)
Standard Output
org.eclipse.jdt.core.tests.compiler.regression.GenericTypeTest#test1437 - 1.8 X.java [ import java.util.*; public class X { <U extends List<?>, T extends Throwable> X(List<U> lu, T t) throws T { if (lu.isEmpty()) throw t; } void bar(List l, IllegalArgumentException iae) { try { new X(l, iae); } catch (IllegalArgumentException e) { } } } ] Full results sent to /home/jenkins/agent/workspace/eclipse.jdt.core-run.javac-1.8/tmp/comptest/run.1584479137560/1.8.0_202_20200317_210541.txt
Standard Error
--- javac err: --- X.java:6: warning: [rawtypes] found raw type: List void bar(List l, IllegalArgumentException iae) { ^ missing type arguments for generic class List<E> where E is a type-variable: E extends Object declared in interface List X.java:8: warning: [unchecked] unchecked method invocation: constructor <init> in class X is applied to given types new X(l, iae); ^ required: List<U>,T found: List,IllegalArgumentException where U,T are type-variables: U extends List<?> declared in constructor <U,T>X(List<U>,T) T extends Throwable declared in constructor <U,T>X(List<U>,T) X.java:8: warning: [unchecked] unchecked conversion new X(l, iae); ^ required: List<U> found: List where U,T are type-variables: U extends List<?> declared in constructor <U,T>X(List<U>,T) T extends Throwable declared in constructor <U,T>X(List<U>,T) 3 warnings ----------------------------------------