mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java-inference] Failure contract inference improved
GitOrigin-RevId: 687b4c909c1d2ae67d519ec71899d52fa3e29434
This commit is contained in:
committed by
intellij-monorepo-bot
parent
23e19832d4
commit
b4c69a9cec
@@ -13,6 +13,25 @@ import java.nio.file.Files;
|
||||
*/
|
||||
@SuppressWarnings({"unused", "IOResourceOpenedButNotSafelyClosed"})
|
||||
public class Test01 {
|
||||
@ExpectContract("true,_->fail")
|
||||
static void checkNegate(boolean val, String s1) {
|
||||
check(!val, s1, null);
|
||||
}
|
||||
|
||||
@ExpectContract("false,_->fail")
|
||||
static void check1(boolean val, String s1) {
|
||||
check(val, s1, null);
|
||||
}
|
||||
|
||||
@ExpectContract("false,_,_->fail")
|
||||
static void check(boolean val, String s1, String s2) {
|
||||
if (!val) {
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user