mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-30 16:21:49 +07:00
for "Null check can be replaced with method call" inspection GitOrigin-RevId: ffa45cce88afb341cdeb9a49d4ee256251865bfc
18 lines
337 B
Java
18 lines
337 B
Java
// "Replace 'if' statement with 'Objects.requireNonNullElse()' call" "GENERIC_ERROR_OR_WARNING"
|
|
|
|
import java.util.*;
|
|
|
|
class Util {
|
|
String method(String s) {return s;}
|
|
}
|
|
|
|
class Test {
|
|
public void test(String o) {
|
|
Object another;
|
|
if<caret>(o == null) {
|
|
Util.method("Hello");
|
|
} else {
|
|
Util.method(o);
|
|
}
|
|
}
|
|
} |