DFA - excluded boolean fix suggestion in conditional expressions which contain null expression types to prevent compilation error

GitOrigin-RevId: b0b956ad677ce1ecdc80070e25877aef8dc65100
This commit is contained in:
Ilyas Selimov
2021-05-14 20:36:59 +07:00
committed by intellij-monorepo-bot
parent 15070abb9b
commit d82ff9650f
8 changed files with 89 additions and 9 deletions

View File

@@ -0,0 +1,7 @@
// "Simplify 'arg.isEmpty()' to false" "true"
class Test {
void test() {
String arg = "12";
Integer result = 2 * 1;
}
}

View File

@@ -0,0 +1,7 @@
// "Simplify 'arg.isEmpty()' to false" "true"
class Test {
void test() {
String arg = "12";
String result = arg + null;
}
}

View File

@@ -0,0 +1,7 @@
// "Simplify 'arg.isEmpty()' to false" "false"
class Test {
void test() {
String arg = "12";
Boolean result = arg != null && (<caret>arg.isEmpty() ? true : null);
}
}

View File

@@ -0,0 +1,7 @@
// "Simplify 'arg.isEmpty()' to false" "false"
class Test {
void test() {
String arg = "12";
Integer result = 2 * (<caret>arg.isEmpty() ? 1 : null);
}
}

View File

@@ -0,0 +1,7 @@
// "Simplify 'arg.isEmpty()' to false" "true"
class Test {
void test() {
String arg = "12";
Integer result = 2 * (<caret>arg.isEmpty() ? null : 1);
}
}

View File

@@ -0,0 +1,7 @@
// "Simplify 'arg.isEmpty()' to false" "true"
class Test {
void test() {
String arg = "12";
String result = arg + (<caret>arg.isEmpty() ? 1 : null);
}
}