mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-31 01:43:23 +07:00
for "Null check can be replaced with method call" inspection GitOrigin-RevId: ffa45cce88afb341cdeb9a49d4ee256251865bfc
18 lines
319 B
Java
18 lines
319 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;
|
|
if<caret>(o == null) {
|
|
another = new Object();
|
|
} else {
|
|
another = o;
|
|
}
|
|
}
|
|
} |