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:
}
}
}
@@ -15,11 +15,18 @@
*/
package com.intellij.codeInsight.daemon.quickFix;
import com.siyeh.ig.controlflow.RedundantElseInspection;
/**
* User: anna
* Date: Aug 30, 2010
*/
public class RemoveRedundantElseActionTest extends LightQuickFixParameterizedTestCase {
public class RemoveRedundantElseFixTest extends LightQuickFixParameterizedTestCase {
@Override
protected void setUp() throws Exception {
super.setUp();
enableInspectionTool(new RedundantElseInspection());
}
public void test() throws Exception { doAllTests(); }