File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
nullaway/src/test/java/com/uber/nullaway/jspecify Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -2084,6 +2084,24 @@ public void issue1126() {
20842084 " Supplier<? extends @Nullable Object> s = () -> null;" ,
20852085 " }" ,
20862086 "}" )
2087+ .addSourceLines (
2088+ "Test2.java" ,
2089+ "package com.uber;" ,
2090+ "import java.util.HashMap;" ,
2091+ "import java.util.Map;" ,
2092+ "import org.jspecify.annotations.Nullable;" ,
2093+ "import org.jetbrains.annotations.Contract;" ,
2094+ "public class Test2 {" ,
2095+ " @Contract(\" null -> true\" )" ,
2096+ " public static boolean isEmpty(@Nullable Map<?, ? extends @Nullable Object> map) {" ,
2097+ " return (map == null || map.isEmpty());" ,
2098+ " }" ,
2099+ " static void foo() {" ,
2100+ " Map<String, @Nullable Object> variables = new HashMap<>();" ,
2101+ " if (isEmpty(variables)) { /* do nothing */ }" ,
2102+ " variables.toString();" ,
2103+ " }" ,
2104+ "}" )
20872105 .doTest ();
20882106 }
20892107
You can’t perform that action at this time.
0 commit comments