Files
openide/java/java-tests/testData/codeInsight/nullityinferrer/afterParameterCheckedForNull.java
Georgii Ustinov a4d5e41d7f [Java. Code Formatting] Rewrite the way of detection type annotation in JavaFormatterUtil
IDEA-353192

GitOrigin-RevId: 34e375e4e1e059be03aad12c2839911b8315ed06
2024-06-04 06:46:24 +00:00

34 lines
568 B
Java

import org.jetbrains.annotations.*;
class Test {
void bar(@Nullable String str) {
if (str == null) {
foo(str);
}
}
String foo(String str) {
return str;
}
@NotNull String foo1(@Nullable String str) {
if (str == null) return "null";
return (str);
}
@NotNull String foo2(@Nullable String str) {
if (str == null) return "null";
return ((String)str);
}
@NotNull String fram(@Nullable String str, boolean b) {
if (str != null) {
return b ? str : "not null strimg";
}
return "str was null";
}
}