mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-09 20:42:52 +07:00
highlight nullable methods that always return a non-null value (IDEA-166399)
This commit is contained in:
+15
@@ -0,0 +1,15 @@
|
||||
import org.jetbrains.annotations.*;
|
||||
|
||||
final class Foo {
|
||||
@<warning descr="@Nullable method 'foo' always return a non-null value">Nullable</warning> Object foo(int param) {
|
||||
return param == 1 ? new Object() {
|
||||
Object unrelated() {
|
||||
return <warning descr="'null' is returned by the method which is not declared as @Nullable">null</warning>;
|
||||
}
|
||||
} : bar();
|
||||
}
|
||||
|
||||
@NotNull Foo bar() {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user