Skip to content

Failed

org.eclipse.jdt.core.tests.compiler.regression.NullAnnotationTest.test_default_nullness_002_custom - 11 (from org.eclipse.jdt.core.tests.compiler.regression.TestAll)

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

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:2354)

Standard Output

org.eclipse.jdt.core.tests.compiler.regression.NullAnnotationTest#test_default_nullness_002_custom - 11
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 /tmp/genie.jdt/comptest/run.1565427784609/11_20190810_050312.txt

Standard Error

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