Java: Merged ConfusingElseInspection and RemoveRedundantElseAction into RedundantElseInspection, made it an INFORMATION-level inspection (IDEA-162191)

This commit is contained in:
Pavel Dolgov
2016-12-06 17:42:37 +03:00
parent 8aca86cf3e
commit 05744d1ffd
20 changed files with 175 additions and 275 deletions
@@ -0,0 +1,10 @@
// "Remove redundant 'else'" "true"
class T {
static void foo(boolean something) {
if (something) {
return;
} // a
System.out.println(); // b
// c
}
}
@@ -0,0 +1,13 @@
// "Remove redundant 'else'" "true"
class T {
void three(boolean b) {
switch (3) {
case 2:
if (foo()) {
return;
}
return;
case 3:
}
}
}
@@ -0,0 +1,12 @@
// "Remove redundant 'else'" "true"
class T {
static void foo(boolean something) {
if (something) {
return;
}
else<caret> { // a
System.out.println(); // b
// c
}
}
}
@@ -0,0 +1,15 @@
// "Remove redundant 'else'" "true"
class T {
void three(boolean b) {
switch (3) {
case 2:
if (foo()) {
return;
}
else<caret> {
return;
}
case 3:
}
}
}