ReplaceNullCheckInspection: add qualifier for field null check, simplify

This commit is contained in:
Roman Ivanov
2018-02-05 17:18:15 +07:00
parent d9f111dc4b
commit 1321f43566
5 changed files with 113 additions and 107 deletions
@@ -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);
}
}
}