BoolUtils: make it recognize methods with negated counterparts: IDEA-199888

This commit is contained in:
Roman.Ivanov
2018-10-04 17:39:11 +07:00
parent c4b7de202d
commit ecc74e9a2d
6 changed files with 141 additions and 0 deletions
@@ -0,0 +1,9 @@
import java.util.stream.Stream;
public class Foo {
void m(Stream<String> s) {
if (s.anyMatch(str -> str.equals("foo")).not<caret>) {
}
}
}
@@ -0,0 +1,9 @@
import java.util.stream.Stream;
public class Foo {
void m(Stream<String> s) {
if (s.noneMatch(str -> str.equals("foo"))<caret>) {
}
}
}
@@ -0,0 +1,9 @@
import java.util.Optional;
public class Foo {
void m() {
if (Optional.of("").isPresent().not<caret>) {
}
}
}
@@ -0,0 +1,9 @@
import java.util.Optional;
public class Foo {
void m() {
if (Optional.of("").isEmpty()<caret>) {
}
}
}