mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-05 23:46:49 +07:00
for "Null check can be replaced with method call" inspection GitOrigin-RevId: ffa45cce88afb341cdeb9a49d4ee256251865bfc
19 lines
457 B
Java
19 lines
457 B
Java
// "Replace 'if' statement with 'Objects.requireNonNullElse()' call" "false"
|
|
|
|
class Component {
|
|
public Component add(Component component, int index) {
|
|
return new Component();
|
|
}
|
|
}
|
|
|
|
class Usage extends Component {
|
|
protected Component cont = new Usage();
|
|
|
|
@Override
|
|
public Component add(Component component, int index) {
|
|
if<caret> (cont == null) {
|
|
return (super.add(component, index));
|
|
}
|
|
return cont.add(component, index);
|
|
}
|
|
} |