mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
Fixes IDEA-145194 Do not report 'Not-null fields must be initialized' when field is initialized indirectly GitOrigin-RevId: c3bae51deaedbbbb4d035e5d7d3b55f2ca9b8c03
36 lines
614 B
Java
36 lines
614 B
Java
import org.jetbrains.annotations.*;
|
|
|
|
class Test {
|
|
@NotNull String str1;
|
|
<warning descr="Not-null fields must be initialized">@NotNull</warning> String str2;
|
|
@NotNull String str3;
|
|
<warning descr="Not-null fields must be initialized">@NotNull</warning> String str4;
|
|
|
|
Test() {
|
|
init();
|
|
this.initStr3();
|
|
new Test().initStr4();
|
|
}
|
|
|
|
Test(String s) {
|
|
this();
|
|
str2 = s;
|
|
}
|
|
|
|
void initStr3() {
|
|
str3 = "";
|
|
}
|
|
|
|
void initStr4() {
|
|
str4 = "";
|
|
}
|
|
|
|
void init() {
|
|
if (Math.random() > 0.5) {
|
|
str1 = "";
|
|
str2 = "";
|
|
} else {
|
|
str1 = "123";
|
|
}
|
|
}
|
|
} |