Failed
org.eclipse.jdt.core.tests.compiler.regression.NullAnnotationTest.test_default_nullness_002_custom - 1.8 (from org.eclipse.jdt.core.tests.compiler.regression.TestAll)
Error Message
test_default_nullness_002_custom - Eclipse found error(s) but Javac did not find any. ----------- Expected ------------ ------------ but was ------------ ----------\n 1. ERROR in Y.java (at line 5)\n @Nullable Object getObject(Object o) {\n ^^^^^^^^^^^^^^^^\n The return type is incompatible with '@NonNull Object' returned from X.getObject(Object) (mismatching null constraints)\n ----------\n 2. ERROR in Y.java (at line 5)\n @Nullable Object getObject(Object o) {\n ^^^^^^\n Illegal redefinition of parameter o, inherited method from X declares this parameter as @Nullable\n ----------\n --------- Difference is ---------- expected:<[]> but was:<[----------\n 1. ERROR in Y.java (at line 5)\n @Nullable Object getObject(Object o) {\n ^^^^^^^^^^^^^^^^\n The return type is incompatible with '@NonNull Object' returned from X.getObject(Object) (mismatching null constraints)\n ----------\n 2. ERROR in Y.java (at line 5)\n @Nullable Object getObject(Object o) {\n ^^^^^^\n Illegal redefinition of parameter o, inherited method from X declares this parameter as @Nullable\n ----------\n ]>
Stacktrace
junit.framework.ComparisonFailure: test_default_nullness_002_custom - Eclipse found error(s) but Javac did not find any. ----------- Expected ------------ ------------ but was ------------ ----------\n 1. ERROR in Y.java (at line 5)\n @Nullable Object getObject(Object o) {\n ^^^^^^^^^^^^^^^^\n The return type is incompatible with '@NonNull Object' returned from X.getObject(Object) (mismatching null constraints)\n ----------\n 2. ERROR in Y.java (at line 5)\n @Nullable Object getObject(Object o) {\n ^^^^^^\n Illegal redefinition of parameter o, inherited method from X declares this parameter as @Nullable\n ----------\n --------- Difference is ---------- expected:<[]> but was:<[----------\n 1. ERROR in Y.java (at line 5)\n @Nullable Object getObject(Object o) {\n ^^^^^^^^^^^^^^^^\n The return type is incompatible with '@NonNull Object' returned from X.getObject(Object) (mismatching null constraints)\n ----------\n 2. ERROR in Y.java (at line 5)\n @Nullable Object getObject(Object o) {\n ^^^^^^\n Illegal redefinition of parameter o, inherited method from X declares this parameter as @Nullable\n ----------\n ]> at org.eclipse.jdt.core.tests.compiler.regression.NullAnnotationTest.test_default_nullness_002_custom(NullAnnotationTest.java:2355)
Standard Output
org.eclipse.jdt.core.tests.compiler.regression.NullAnnotationTest#test_default_nullness_002_custom - 1.8 org/foo/Nullable.java [ package org.foo; import static java.lang.annotation.ElementType.*; import java.lang.annotation.*; @Retention(RetentionPolicy.CLASS) @Target({METHOD,PARAMETER,LOCAL_VARIABLE}) public @interface Nullable { } ] org/foo/NonNullByDefault.java [ package org.foo; import java.lang.annotation.*; import static java.lang.annotation.ElementType.*; @Retention(RetentionPolicy.CLASS) @Target({PACKAGE, TYPE, METHOD, CONSTRUCTOR }) public @interface NonNullByDefault { } ] X.java [ import org.foo.*; @NonNullByDefault public class X { Object getObject(@Nullable Object o) { return new Object(); } } ] Y.java [ import org.foo.*; @NonNullByDefault public class Y extends X { @Override @Nullable Object getObject(Object o) { return o; } } ] Full results sent to /home/jenkins/agent/workspace/eclipse.jdt.core-run.javac-1.8/tmp/comptest/run.1584479137560/1.8.0_202_20200317_210541.txt
Standard Error
----------------------------------------