mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
Java: Merged ConfusingElseInspection and RemoveRedundantElseAction into RedundantElseInspection, made it an INFORMATION-level inspection (IDEA-162191)
This commit is contained in:
+10
@@ -0,0 +1,10 @@
|
||||
// "Remove redundant 'else'" "true"
|
||||
class T {
|
||||
static void foo(boolean something) {
|
||||
if (something) {
|
||||
return;
|
||||
} // a
|
||||
System.out.println(); // b
|
||||
// c
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// "Remove redundant 'else'" "true"
|
||||
class T {
|
||||
void three(boolean b) {
|
||||
switch (3) {
|
||||
case 2:
|
||||
if (foo()) {
|
||||
return;
|
||||
}
|
||||
return;
|
||||
case 3:
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
+15
@@ -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:
|
||||
}
|
||||
}
|
||||
}
|
||||
+8
-1
@@ -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(); }
|
||||
|
||||
Reference in New Issue
Block a user