Failed

org.eclipse.jdt.core.tests.compiler.regression.LambdaRegressionTest.testBug472648 - 1.8 (from org.eclipse.jdt.core.tests.compiler.regression.TestAll)

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

Error Message

testBug472648 - Eclipse found error(s) but Javac did not find any.
----------- Expected ------------

------------ but was ------------
----------\n
1. ERROR in Test.java (at line 14)\n
 forEachValueOfType(numList, Integer.class, (Integer i) -> (System.out.println(Integer.toString(i))));\n
 ^^^^^^^^^^^^^^^^^^\n
The method forEachValueOfType(List<?>, Class<T>, Consumer<T>) in the type Test is not applicable for the arguments (List<Number>, Class<Integer>, (Integer i) -> {})\n
----------\n
2. ERROR in Test.java (at line 14)\n
 forEachValueOfType(numList, Integer.class, (Integer i) -> (System.out.println(Integer.toString(i))));\n
                                             ^^^^^^^\n
Incompatible type specified for lambda expression's parameter i\n
----------\n
3. ERROR in Test.java (at line 14)\n
 forEachValueOfType(numList, Integer.class, (Integer i) -> (System.out.println(Integer.toString(i))));\n
                                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n
Invalid expression as statement\n
----------\n

--------- Difference is ----------
 expected:<[]> but was:<[----------\n
1. ERROR in Test.java (at line 14)\n
 forEachValueOfType(numList, Integer.class, (Integer i) -> (System.out.println(Integer.toString(i))));\n
 ^^^^^^^^^^^^^^^^^^\n
The method forEachValueOfType(List<?>, Class<T>, Consumer<T>) in the type Test is not applicable for the arguments (List<Number>, Class<Integer>, (Integer i) -> {})\n
----------\n
2. ERROR in Test.java (at line 14)\n
 forEachValueOfType(numList, Integer.class, (Integer i) -> (System.out.println(Integer.toString(i))));\n
                                             ^^^^^^^\n
Incompatible type specified for lambda expression's parameter i\n
----------\n
3. ERROR in Test.java (at line 14)\n
 forEachValueOfType(numList, Integer.class, (Integer i) -> (System.out.println(Integer.toString(i))));\n
                                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n
Invalid expression as statement\n
----------\n
]>

Stacktrace

junit.framework.ComparisonFailure: testBug472648 - Eclipse found error(s) but Javac did not find any.
----------- Expected ------------

------------ but was ------------
----------\n
1. ERROR in Test.java (at line 14)\n
	forEachValueOfType(numList, Integer.class, (Integer i) -> (System.out.println(Integer.toString(i))));\n
	^^^^^^^^^^^^^^^^^^\n
The method forEachValueOfType(List<?>, Class<T>, Consumer<T>) in the type Test is not applicable for the arguments (List<Number>, Class<Integer>, (Integer i) -> {})\n
----------\n
2. ERROR in Test.java (at line 14)\n
	forEachValueOfType(numList, Integer.class, (Integer i) -> (System.out.println(Integer.toString(i))));\n
	                                            ^^^^^^^\n
Incompatible type specified for lambda expression's parameter i\n
----------\n
3. ERROR in Test.java (at line 14)\n
	forEachValueOfType(numList, Integer.class, (Integer i) -> (System.out.println(Integer.toString(i))));\n
	                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n
Invalid expression as statement\n
----------\n

--------- Difference is ----------
 expected:<[]> but was:<[----------\n
1. ERROR in Test.java (at line 14)\n
	forEachValueOfType(numList, Integer.class, (Integer i) -> (System.out.println(Integer.toString(i))));\n
	^^^^^^^^^^^^^^^^^^\n
The method forEachValueOfType(List<?>, Class<T>, Consumer<T>) in the type Test is not applicable for the arguments (List<Number>, Class<Integer>, (Integer i) -> {})\n
----------\n
2. ERROR in Test.java (at line 14)\n
	forEachValueOfType(numList, Integer.class, (Integer i) -> (System.out.println(Integer.toString(i))));\n
	                                            ^^^^^^^\n
Incompatible type specified for lambda expression's parameter i\n
----------\n
3. ERROR in Test.java (at line 14)\n
	forEachValueOfType(numList, Integer.class, (Integer i) -> (System.out.println(Integer.toString(i))));\n
	                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n
Invalid expression as statement\n
----------\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:2044)
	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.LambdaRegressionTest.testBug472648(LambdaRegressionTest.java:963)

Standard Output

org.eclipse.jdt.core.tests.compiler.regression.LambdaRegressionTest#testBug472648 - 1.8
Test.java [
import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;
public class Test {
	public static void main(String argv[]) {
		new Test();
	}
	public Test() {
		List<Number> numList = new ArrayList<>();
		numList.add(1);
		numList.add(1.5);
		numList.add(2);
		numList.add(2.5);
		forEachValueOfType(numList, Integer.class, (Integer i) -> (System.out.println(Integer.toString(i))));
	}
	private <T> void forEachValueOfType(List<?> list, Class<T> type, Consumer<T> action) {
		
		for (Object o : list) {
			if (type.isAssignableFrom(o.getClass())) {
				@SuppressWarnings("unchecked")
				T convertedObject = (T) o;
				action.accept(convertedObject);
			}
		}
	}
}
]


Full results sent to /tmp/comptest/run.1514610271420/1.8.0_131_20171230_000432.txt

Standard Error

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