mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 02:09:59 +07:00
remove unnecessary parentheses in IDEA-161061 Quick-fix to replace nullableExpr.equals(...) with Objects.equals(nullableExpr, ...) (IDEA-CR-13960)
This commit is contained in:
@@ -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();
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
Reference in New Issue
Block a user