mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-31 23:21:09 +07:00
for "Null check can be replaced with method call" inspection GitOrigin-RevId: ffa45cce88afb341cdeb9a49d4ee256251865bfc
14 lines
287 B
Java
14 lines
287 B
Java
// "Replace 'if' statement with 'Objects.requireNonNullElseGet()' call" "true"
|
|
|
|
import java.util.*;
|
|
|
|
class Util {
|
|
String method(String s) {return s;}
|
|
}
|
|
|
|
class Test {
|
|
public void test(Object o) {
|
|
Object another;
|
|
another = Objects.requireNonNullElseGet(o, Object::new);
|
|
}
|
|
} |