Skip to content

Failed

org.eclipse.jdt.core.tests.compiler.regression.MethodVerifyTest.testBug536978_comment5 - 11 (from org.eclipse.jdt.core.tests.compiler.regression.TestAll)

Failing for the past 35 builds (Since #9 )
Took 0.87 sec.

Error Message

testBug536978_comment5 - Eclipse/Javac standard output mismatch.
----------- Expected ------------
class Result1 cannot be cast to class OtherResult (Result1 and OtherResult are in unnamed module of loader
------------ but was ------------
class Result1 cannot be cast to class OtherResult (Result1 and OtherResult are in unnamed module of loader 'app')
--------- Difference is ----------
 expected:<...med module of loader[]> but was:<...med module of loader[ 'app')]>

Stacktrace

junit.framework.ComparisonFailure: 
testBug536978_comment5 - Eclipse/Javac standard output mismatch.
----------- Expected ------------
class Result1 cannot be cast to class OtherResult (Result1 and OtherResult are in unnamed module of loader
------------ but was ------------
class Result1 cannot be cast to class OtherResult (Result1 and OtherResult are in unnamed module of loader 'app')
--------- Difference is ----------
 expected:<...med module of loader[]> but was:<...med module of loader[ 'app')]>
	at org.eclipse.jdt.core.tests.compiler.regression.MethodVerifyTest.testBug536978_comment5(MethodVerifyTest.java:14440)

Standard Output

org.eclipse.jdt.core.tests.compiler.regression.MethodVerifyTest#testBug536978_comment5 - 11
SimpleDemo.java [

abstract interface AbstractResult {
	public abstract int test();
}

abstract class AbstractDemo<Request extends AbstractResult, Response extends AbstractResult> {
	protected abstract Response test(Request request);

}

class Result1 implements AbstractResult {
	public int test() {
		return 1;
	}
}

class OtherResult implements AbstractResult {
	public int test() {
		return 2;
	}
}

public class SimpleDemo<Request extends AbstractResult, Response extends AbstractResult> extends AbstractDemo<Request, Response> {
	@Override @SuppressWarnings("unchecked")
	protected AbstractResult test(AbstractResult request) {
		return new Result1();
	}

	public static void main(String... args) {
		AbstractDemo<OtherResult, OtherResult> demo = new SimpleDemo<OtherResult, OtherResult>();
		try {
			OtherResult result = demo.test(new OtherResult());
		} catch (ClassCastException e) {
			System.out.println(e.getMessage());
		}
	}
}

]


Full results sent to /tmp/genie.jdt/comptest/run.1565427784609/11_20190810_050312.txt

Standard Error

--- javac err: ---
SimpleDemo.java:25: warning: [unchecked] test(AbstractResult) in SimpleDemo overrides test(Request) in AbstractDemo
	protected AbstractResult test(AbstractResult request) {
	                         ^
  return type requires unchecked conversion from AbstractResult to Response#2
  where Request,Response#1,Response#2 are type-variables:
    Request extends AbstractResult declared in class AbstractDemo
    Response#1 extends AbstractResult declared in class AbstractDemo
    Response#2 extends AbstractResult declared in class SimpleDemo
1 warning

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