mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java-dfa] Test for IDEA-365762 False positive 'Method invocation may produce NullPointerException' warning
Fixed by IDEA-363662 GitOrigin-RevId: 94d3216ee928118cce2a3479d2f83bffef7baf2c
This commit is contained in:
committed by
intellij-monorepo-bot
parent
a90dbf10c8
commit
0adf3c4bc9
+21
-1
@@ -23,4 +23,24 @@ record Bar(A a, B b) {
|
||||
record A() {
|
||||
Object getObj(String s, B b) {return new Object();}
|
||||
}
|
||||
record B() {}
|
||||
record B() {}
|
||||
|
||||
// IDEA-365762
|
||||
class Test {
|
||||
private final @Nullable Object finalField;
|
||||
|
||||
public Test(@Nullable Object finalField) {
|
||||
this.finalField = finalField;
|
||||
}
|
||||
|
||||
public void test() {
|
||||
if (finalField != null) {
|
||||
finalField.toString();
|
||||
nop();
|
||||
finalField.toString();
|
||||
}
|
||||
}
|
||||
|
||||
private void nop() {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user