mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
Java inspection: Returned back RemoveRedundantElseAction intention, because it turns out it's useful in some cases (IDEA-157727)
This commit is contained in:
+13
@@ -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++;
|
||||
}
|
||||
}
|
||||
|
||||
+14
@@ -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++;
|
||||
}
|
||||
}
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// "Remove redundant 'else'" "false"
|
||||
import java.io.IOException;
|
||||
class a {
|
||||
void foo(boolean condition) throws IOException{
|
||||
if (condition) {
|
||||
tMethod();
|
||||
}
|
||||
e<caret>lse {
|
||||
System.out.println("else");
|
||||
}
|
||||
}
|
||||
|
||||
void tMethod() throws IOException {}
|
||||
}
|
||||
|
||||
+17
@@ -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++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user