[java-analysis] Test for IDEA-266180

GitOrigin-RevId: bf9e92df66a2b0abf56230cefa04887abc847b22
This commit is contained in:
Tagir Valeev
2021-04-23 11:24:56 +07:00
committed by intellij-monorepo-bot
parent 4a570152e3
commit 231c892de2
2 changed files with 11 additions and 3 deletions

View File

@@ -7,6 +7,8 @@ import java.io.FileReader;
import java.io.IOException;
import java.lang.reflect.Array;
import java.nio.file.Files;
import java.util.List;
import java.util.ArrayList;
/**
* @author lambdamix
@@ -28,7 +30,7 @@ public class Test01 {
static void checkNull(Object object, String s) {
check(object == null, s, s);
}
@ExpectContract("true,_->fail")
static void checkNegate(boolean val, String s1) {
check(!val, s1, null);
@@ -45,9 +47,9 @@ public class Test01 {
throw new RuntimeException(createMessage(s1, s2));
}
}
native static String createMessage(String s1, String s2);
@ExpectNotNull
@ExpectContract(pure = true)
public static MySupplier methodReference(@ExpectNotNull String s) {
@@ -320,4 +322,10 @@ public class Test01 {
res[0] = null;
return res;
}
@ExpectNotNull
@ExpectContract(pure = true)
List<String> getCollection() {
return new ArrayList<>();
}
}