File tree 2 files changed +29
-0
lines changed
nullaway/src/test/java/com/uber/nullaway/jspecify
test-java-lib/src/main/java/com/uber/lib/generics
2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 3
3
import com .google .errorprone .CompilationTestHelper ;
4
4
import com .uber .nullaway .NullAwayTestsBase ;
5
5
import java .util .Arrays ;
6
+ import org .junit .Ignore ;
6
7
import org .junit .Test ;
7
8
8
9
public class BytecodeGenericsTests extends NullAwayTestsBase {
@@ -222,6 +223,25 @@ public void overrideReturnTypes() {
222
223
.doTest ();
223
224
}
224
225
226
+ @ Test
227
+ @ Ignore ("Failing due to https://bugs.openjdk.org/browse/JDK-8337795" )
228
+ // TODO Re-enable this test once the JDK bug is fixed, on appropriate JDK versions
229
+ // See https://github.com/uber/NullAway/issues/1011
230
+ public void callMethodTakingJavaUtilFunction () {
231
+ makeHelper ()
232
+ .addSourceLines (
233
+ "Test.java" ,
234
+ "package com.uber;" ,
235
+ "import org.jspecify.annotations.Nullable;" ,
236
+ "import com.uber.lib.generics.JavaUtilFunctionMethods;" ,
237
+ "class Test {" ,
238
+ " static void testNegative() {" ,
239
+ " JavaUtilFunctionMethods.withFunction(s -> { return null; });" ,
240
+ " }" ,
241
+ "}" )
242
+ .doTest ();
243
+ }
244
+
225
245
private CompilationTestHelper makeHelper () {
226
246
return makeTestHelperWithArgs (
227
247
Arrays .asList (
Original file line number Diff line number Diff line change
1
+ package com .uber .lib .generics ;
2
+
3
+ import java .util .function .Function ;
4
+ import org .jspecify .annotations .Nullable ;
5
+
6
+ public class JavaUtilFunctionMethods {
7
+
8
+ public static void withFunction (Function <String , @ Nullable String > f ) {}
9
+ }
You can’t perform that action at this time.
0 commit comments