mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 00:11:26 +07:00
fix ControlFlowUtil.canCompleteNormally() regression (IDEA-141259)
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
// "Replace 'switch' with 'if'" "true"
|
||||
class X {
|
||||
|
||||
void m(String s, int a) throws IOException {
|
||||
if ("a".equals(s)) {
|
||||
a();
|
||||
} else {
|
||||
d();
|
||||
}
|
||||
}
|
||||
|
||||
void a() throws IOException { }
|
||||
void d() throws IOException { }
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
// "Replace 'switch' with 'if'" "true"
|
||||
class X {
|
||||
void test4() throws IOException {
|
||||
String variable = "abc";
|
||||
if ("abc".equals(variable)) {
|
||||
String s1 = "abcd";
|
||||
} else if ("def".equals(variable)) {
|
||||
String s1 = "abcd";
|
||||
myFunction(s1);
|
||||
} else {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
|
||||
public void myFunction(Object o1) throws IOException {
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// "Replace 'switch' with 'if'" "true"
|
||||
class X {
|
||||
|
||||
void m(String s, int a) throws IOException {
|
||||
switch<caret> (s) {
|
||||
case "a": {
|
||||
a();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
d();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void a() throws IOException { }
|
||||
void d() throws IOException { }
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
// "Replace 'switch' with 'if'" "true"
|
||||
class X {
|
||||
void test4() throws IOException {
|
||||
String variable = "abc";
|
||||
<caret>switch (variable) {
|
||||
case "abc": {
|
||||
String s1 = "abcd";
|
||||
break;
|
||||
}
|
||||
case "def": {
|
||||
String s1 = "abcd";
|
||||
myFunction(s1);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
|
||||
public void myFunction(Object o1) throws IOException {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user