mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 06:05:01 +07:00
IDEA-209947 Explanation for always failing call
GitOrigin-RevId: 9236c7ce5db9a27f0b2c793f54e500d6ef64d78c
This commit is contained in:
committed by
intellij-monorepo-bot
parent
fb79b6d617
commit
4fb16241d8
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
Call always fails (foo(s, "checked"); line#12)
|
||||
According to inferred contract, method 'foo' throws exception when obj == null (foo; line#12)
|
||||
Condition 's == null' was checked before (s == null; line#11)
|
||||
*/
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
class Test {
|
||||
void test(String s) {
|
||||
if (s == null) {
|
||||
<selection>foo(s, "checked")</selection>;
|
||||
}
|
||||
}
|
||||
|
||||
static void foo(Object obj, String message) {
|
||||
if(obj == null) {
|
||||
throw new RuntimeException(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user