Skip to content

Failed

org.eclipse.jdt.core.tests.compiler.regression.GenericTypeTest.test1438 - 1.8 (from org.eclipse.jdt.core.tests.compiler.regression.TestAll)

Failing for the past 4 builds (Since #6 )
Took 0.66 sec.

Error Message

test1438 - 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 <anonymous X$1> 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 <anonymous X$1> 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: test1438 - 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 <anonymous X$1> 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 <anonymous X$1> 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.junit.extension.TestCase.assertStringEquals(TestCase.java:260)
	at org.eclipse.jdt.core.tests.junit.extension.TestCase.assertEquals(TestCase.java:236)
	at org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runJavac(AbstractRegressionTest.java:2048)
	at org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runTest(AbstractRegressionTest.java:2814)
	at org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runTest(AbstractRegressionTest.java:2539)
	at org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runNegativeTest(AbstractRegressionTest.java:2113)
	at org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runNegativeTest(AbstractRegressionTest.java:2102)
	at org.eclipse.jdt.core.tests.compiler.regression.GenericTypeTest.test1438(GenericTypeTest.java:50484)

Standard Output

org.eclipse.jdt.core.tests.compiler.regression.GenericTypeTest#test1438 - 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 /tmp/comptest/run.1514610271420/1.8.0_131_20171230_000432.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 <anonymous X$1> 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

----------------------------------------