mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 10:20:15 +07:00
DFA - added Boolean.TRUE/FALSE.equals() quick fix to unbox boolean nullable variable
GitOrigin-RevId: 45952b11139cf435e218ddd9c3ba57e237230eed
This commit is contained in:
committed by
intellij-monorepo-bot
parent
445cb5d8d2
commit
a117b21680
@@ -0,0 +1,12 @@
|
||||
// "Replace with 'Boolean.FALSE.equals(flag)'" "true"
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
class Test {
|
||||
public boolean b;
|
||||
public boolean c;
|
||||
|
||||
boolean test(@Nullable Boolean flag) {
|
||||
return c ? b && Boolean.FALSE.equals(flag) : c;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Replace with 'Boolean.TRUE.equals(flag)'" "true"
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
class Test {
|
||||
boolean test(@Nullable Boolean flag) {
|
||||
if (Boolean.TRUE.equals(flag)) {
|
||||
System.out.println("ok");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Replace with 'Boolean.FALSE.equals(flag)'" "true"
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
class Test {
|
||||
public boolean b;
|
||||
public boolean c;
|
||||
|
||||
boolean test(@Nullable Boolean flag) {
|
||||
return c ? b && !<caret>flag : c;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Replace with 'Boolean.TRUE.equals(flag)'" "true"
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
class Test {
|
||||
boolean test(@Nullable Boolean flag) {
|
||||
if (<caret>flag) {
|
||||
System.out.println("ok");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Replace with 'Boolean.TRUE.equals(flag)'" "false"
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
class Test {
|
||||
int test(@Nullable Integer i) {
|
||||
return <caret>i;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Replace with 'Boolean.TRUE.equals(flag)'" "false"
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
class Test {
|
||||
boolean test(@NotNull Boolean flag) {
|
||||
if (<caret>flag) {
|
||||
System.out.println("ok");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user