remove redundant else: check all then clauses (IDEA-58136)

This commit is contained in:
anna
2010-08-30 20:52:53 +04:00
parent ad9c77ecca
commit 0bb2f844f2
5 changed files with 102 additions and 8 deletions
@@ -0,0 +1,13 @@
// "Remove Redundant 'else'" "true"
class a {
void foo() {
int a = 0;
int b = 0;
if (a != b) {
return;
}
a = b;
a++;
}
}
@@ -0,0 +1,14 @@
// "Remove Redundant 'else'" "true"
class a {
void foo() {
int a = 0;
int b = 0;
if (a != b) {
return;
} e<caret>lse {
a = b;
}
a++;
}
}
@@ -0,0 +1,17 @@
// "Remove Redundant 'else'" "false"
class a {
void foo() {
int a = 0;
int b = 0;
if (a != b) {
a = 10;
} else if (a + 1 == b) {
return;
}
e<caret>lse {
a = b;
}
a++;
}
}