remove unnecessary parentheses in IDEA-161061 Quick-fix to replace nullableExpr.equals(...) with Objects.equals(nullableExpr, ...) (IDEA-CR-13960)

This commit is contained in:
peter
2016-09-21 10:49:59 +02:00
parent 273b3ed9a7
commit 853fc23fe1
3 changed files with 41 additions and 9 deletions

View File

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

View File

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