mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-26 09:45:12 +07:00
ReplaceNullCheckInspection: add qualifier for field null check, simplify
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
// "Replace condition with Stream.ofNullable" "true"
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
class Other {
|
||||
Object val = new Object();
|
||||
|
||||
}
|
||||
|
||||
class Test {
|
||||
|
||||
public Stream test(Other o) {
|
||||
if<caret> (o.val == null) {
|
||||
return Stream.empty();
|
||||
} else {
|
||||
return Stream.ofNullable(o.val);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user