IDEA-161061 Quick-fix to replace nullableExpr.equals(...) with Objects.equals(nullableExpr, ...)

This commit is contained in:
peter
2016-09-20 15:47:14 +02:00
parent f8a835dc97
commit b08872448c
6 changed files with 174 additions and 19 deletions

View File

@@ -0,0 +1,13 @@
// "Replace 'foo().equals(...)' with 'Objects.equals(foo(), ...)'" "true"
import org.jetbrains.annotations.*;
import java.util.Objects;
class A{
void test(Object bar) {
if (Objects.equals(foo(), bar)) {}
}
@Nullable Object foo();
}

View File

@@ -0,0 +1,11 @@
// "Replace 'foo().equals(...)' with 'Objects.equals(foo(), ...)'" "true"
import org.jetbrains.annotations.*;
class A{
void test(Object bar) {
if (foo().equa<caret>ls(bar)) {}
}
@Nullable Object foo();
}