Failed

org.eclipse.jdt.core.tests.compiler.regression.SerializableLambdaTest.testbug479119a - 1.8 (from org.eclipse.jdt.core.tests.compiler.regression.TestAll)

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

Error Message

testbug479119a - Eclipse/Javac standard output mismatch.
----------- Expected ------------
Looking for Testbed.foo\n
Looking for Testbed.foo\n
true\n
Looking for Testbed$Base.method\n
Looking for Testbed$Base.method\n
true\n
Looking for Testbed$MethodRefImpl.<init>\n
Looking for Testbed$MethodRefImpl.<init>\n
true
------------ but was ------------

--------- Difference is ----------
 expected:<[Looking for Testbed.foo\n
Looking for Testbed.foo\n
true\n
Looking for Testbed$Base.method\n
Looking for Testbed$Base.method\n
true\n
Looking for Testbed$MethodRefImpl.<init>\n
Looking for Testbed$MethodRefImpl.<init>\n
true]> but was:<[]>

Stacktrace

junit.framework.ComparisonFailure: testbug479119a - Eclipse/Javac standard output mismatch.
----------- Expected ------------
Looking for Testbed.foo\n
Looking for Testbed.foo\n
true\n
Looking for Testbed$Base.method\n
Looking for Testbed$Base.method\n
true\n
Looking for Testbed$MethodRefImpl.<init>\n
Looking for Testbed$MethodRefImpl.<init>\n
true
------------ but was ------------

--------- Difference is ----------
 expected:<[Looking for Testbed.foo\n
Looking for Testbed.foo\n
true\n
Looking for Testbed$Base.method\n
Looking for Testbed$Base.method\n
true\n
Looking for Testbed$MethodRefImpl.<init>\n
Looking for Testbed$MethodRefImpl.<init>\n
true]> but was:<[]>
	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:2068)
	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:1491)
	at org.eclipse.jdt.core.tests.compiler.regression.SerializableLambdaTest.testbug479119a(SerializableLambdaTest.java:1606)

Standard Output

org.eclipse.jdt.core.tests.compiler.regression.SerializableLambdaTest#testbug479119a - 1.8
Testbed.java [
import java.io.ObjectStreamClass;
import java.io.Serializable;
import java.lang.invoke.SerializedLambda;
import java.lang.reflect.Constructor;
import java.lang.reflect.Executable;
import java.lang.reflect.Method;
import java.util.function.IntFunction;
import java.util.stream.Stream;
public class Testbed {
	public static void main(String[] args) {
		System.out.println(getMethod(Testbed::foo).equals(getMethod(Testbed::foo)));
		System.out.println(getMethod(new Foo()::method).equals(getMethod(new Bar()::method)));
		System.out.println(getMethod(MethodRefImpl::new).equals(getMethod(MethodRefImpl::new)));
	}
	static class MethodRefImpl implements MethodRef {
		@Override
		public void run() {}
	}
	public static class Base {
        public void method () {}
    }
    public static class Foo extends Base {}
    public static class Bar extends Base {}
	private static void foo() { }
	static interface MethodRef extends Runnable, Serializable { }
	private static Executable getMethod(MethodRef methodRef) {
		try {
			final Method invokeWriteReplaceMethod = ObjectStreamClass.class.getDeclaredMethod("invokeWriteReplace", Object.class);
			invokeWriteReplaceMethod.setAccessible(true);
			final SerializedLambda l = (SerializedLambda)invokeWriteReplaceMethod.invoke(
					ObjectStreamClass.lookupAny(methodRef.getClass()),
					methodRef
				);
			System.out.println("Looking for " + l.getImplClass() + "." + l.getImplMethodName());
			boolean isConstructor = l.getImplMethodName().indexOf("<init>") >= 0;
			final Executable[] methods = Stream.of(isConstructor ? Class.forName(l.getImplClass()).getDeclaredConstructors() : Class.forName(l.getImplClass()).getDeclaredMethods()).
				filter(m -> m.getName().equals(isConstructor ? l.getImplClass() : l.getImplMethodName())).
				toArray(isConstructor ? Constructor[]::new : Method[]::new);
			if(methods.length != 1) throw new AssertionError("TODO: check signature");
			return methods[0];
		} catch(Exception e) {
			throw new RuntimeException(e);
		}
	}
}

]


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

Standard Error

--- javac err: ---
Testbed.java:15: warning: [serial] serializable class MethodRefImpl has no definition of serialVersionUID
	static class MethodRefImpl implements MethodRef {
	       ^
1 warning

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