Failed

org.eclipse.jdt.core.tests.compiler.regression.CastTest.testBug428274b - 1.8 (from org.eclipse.jdt.core.tests.compiler.regression.TestAll)

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

Error Message

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

------------ but was ------------
Junk4.java:3: error: incompatible types: T cannot be converted to double\n
        int rounded = (int) Math.round((double) n);\n
                                                ^\n
  where T is a type-variable:\n
    T extends Object declared in class Junk4\n
Junk4.java:3: warning: [cast] redundant cast to <any>\n
        int rounded = (int) Math.round((double) n);\n
                      ^\n
1 error\n
1 warning\n

--------- Difference is ----------
 expected:<[]> but was:<[Junk4.java:3: error: incompatible types: T cannot be converted to double\n
        int rounded = (int) Math.round((double) n);\n
                                                ^\n
  where T is a type-variable:\n
    T extends Object declared in class Junk4\n
Junk4.java:3: warning: [cast] redundant cast to <any>\n
        int rounded = (int) Math.round((double) n);\n
                      ^\n
1 error\n
1 warning\n
]>

Stacktrace

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

------------ but was ------------
Junk4.java:3: error: incompatible types: T cannot be converted to double\n
        int rounded = (int) Math.round((double) n);\n
                                                ^\n
  where T is a type-variable:\n
    T extends Object declared in class Junk4\n
Junk4.java:3: warning: [cast] redundant cast to <any>\n
        int rounded = (int) Math.round((double) n);\n
                      ^\n
1 error\n
1 warning\n

--------- Difference is ----------
 expected:<[]> but was:<[Junk4.java:3: error: incompatible types: T cannot be converted to double\n
        int rounded = (int) Math.round((double) n);\n
                                                ^\n
  where T is a type-variable:\n
    T extends Object declared in class Junk4\n
Junk4.java:3: warning: [cast] redundant cast to <any>\n
        int rounded = (int) Math.round((double) n);\n
                      ^\n
1 error\n
1 warning\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:2052)
	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.runConformTest(AbstractRegressionTest.java:1396)
	at org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runConformTest(AbstractRegressionTest.java:1393)
	at org.eclipse.jdt.core.tests.compiler.regression.CastTest.testBug428274b(CastTest.java:2546)

Standard Output

org.eclipse.jdt.core.tests.compiler.regression.CastTest#testBug428274b - 1.8
Junk4.java [
public class Junk4<T> {
    void setValue(T n) {
        int rounded = (int) Math.round((double) n);
		System.out.println(rounded);
    }
	public static void main(String[] args) {
		Junk4<Number> j = new Junk4<Number>();
		j.setValue(Double.valueOf(3.3));
		j.setValue(Double.valueOf(3.7));
	}
}

]


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

Standard Error

--- javac err: ---
Junk4.java:3: error: incompatible types: T cannot be converted to double
        int rounded = (int) Math.round((double) n);
                                                ^
  where T is a type-variable:
    T extends Object declared in class Junk4
Junk4.java:3: warning: [cast] redundant cast to <any>
        int rounded = (int) Math.round((double) n);
                      ^
1 error
1 warning

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