mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-219189 "Split into 2 if's" generates redundant 'else if' clause
GitOrigin-RevId: 0218fd86bb09eea638be20dd96bd248ce498a399
This commit is contained in:
committed by
intellij-monorepo-bot
parent
fb0f9bb364
commit
1c84c9bef2
@@ -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)
|
||||
}
|
||||
}
|
||||
+11
@@ -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)
|
||||
}
|
||||
}
|
||||
+10
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user