mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-30 23:51:37 +07:00
for "Null check can be replaced with method call" inspection GitOrigin-RevId: ffa45cce88afb341cdeb9a49d4ee256251865bfc
14 lines
300 B
Java
14 lines
300 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;
|
|
Util.method(Objects.requireNonNullElse(o, "Hello"));
|
|
}
|
|
} |