mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
Merge SwitchStatementWithSingleDefaultInspection into SwitchStatementWithTooFewBranches
Fixes IDEA-199499 Improve "Replace 'switch' with 'if'" action and make it a quick-fix for "Switch has too few branches" Now default is not counted as branch in SwitchStatementWithTooFewBranches
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Unwrap 'switch' statement" "true"
|
||||
class X {
|
||||
String test(char c) {
|
||||
if(c == 'a') {
|
||||
if (c == 'a') {
|
||||
System.out.println("foo");
|
||||
} else {
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Unwrap 'switch' statement" "true"
|
||||
class X {
|
||||
String test(char c) {
|
||||
if(c == 'a') {
|
||||
if (c == 'a') {
|
||||
System.out.println("foo");
|
||||
}
|
||||
System.out.println("oops");
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
// "Unwrap 'switch' statement" "true"
|
||||
class X {
|
||||
String test(char c) {
|
||||
if(c == 'a') {
|
||||
if (c == 'a') {
|
||||
System.out.println("foo");
|
||||
return "";
|
||||
}
|
||||
}
|
||||
System.out.println("oops");
|
||||
return "";
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
// "Unwrap 'switch' statement" "true"
|
||||
class X {
|
||||
String test(char c) {
|
||||
if(c == 'a') {
|
||||
if (c == 'a') {
|
||||
System.out.println("foo");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+5
-4
@@ -1,13 +1,14 @@
|
||||
// "Unwrap 'switch' statement" "true"
|
||||
class X {
|
||||
String test(char c) {
|
||||
for(int i=0; i<10; i++)
|
||||
if(c == 'a') {
|
||||
for(int i=0; i<10; i++) {
|
||||
if (c == 'a') {
|
||||
System.out.println("foo");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
System.out.println("bar");
|
||||
System.out.println("oops");
|
||||
}
|
||||
System.out.println("oops");
|
||||
return "";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user