IDEA-219189 "Split into 2 if's" generates redundant 'else if' clause

GitOrigin-RevId: 0218fd86bb09eea638be20dd96bd248ce498a399
This commit is contained in:
Tagir Valeev
2019-08-05 04:02:41 +03:00
committed by intellij-monorepo-bot
parent fb0f9bb364
commit 1c84c9bef2
8 changed files with 63 additions and 4 deletions
@@ -1,5 +1,5 @@
class C {
void foo() {
void foo(boolean a, boolean b, boolean c) {
if (a) {
if (b) {
call();
@@ -0,0 +1,8 @@
public class SplitCondition {
void test(int x) {
if (x > 0) {
if (x < 10) {
} else if (x > 0 && x > 50)
} else if (x > 0 && x > 50)
}
}
@@ -0,0 +1,11 @@
public class SplitCondition {
private static void appendString(String phrase) {
if (phrase != null) {
if (phrase.contains("abc")) {
System.out.println("abc!");
}
} else {
System.out.println("null");
}
}
}
@@ -1,5 +1,5 @@
class C {
void foo() {
void foo(boolean a, boolean b, boolean c) {
if (a &<caret>& b) {
call();
} // foo
@@ -0,0 +1,6 @@
public class SplitCondition {
void test(int x) {
if(x > 0 &<caret>& x < 10) {}
else if(x > 0 && x > 50)
}
}
@@ -0,0 +1,10 @@
public class SplitCondition {
private static void appendString(String phrase) {
if (phrase != null &<caret>& phrase.contains("abc")) {
System.out.println("abc!");
}
else if (phrase == null) {
System.out.println("null");
}
}
}