mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
SwitchBackwardMigrationInspection: add test for throwing exception in branch
This commit is contained in:
+15
@@ -0,0 +1,15 @@
|
||||
// "Replace with old style 'switch' statement" "true"
|
||||
import java.util.*;
|
||||
|
||||
public class GenerateThrow {
|
||||
void foo(int i) {
|
||||
int res;
|
||||
switch (i) {
|
||||
case 0:
|
||||
res = 1;
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Replace with old style 'switch' statement" "true"
|
||||
import java.util.*;
|
||||
|
||||
public class GenerateThrow {
|
||||
void foo(int i) {
|
||||
int res = <caret>switch (i) {
|
||||
case 0 -> 1;
|
||||
default -> throw new IllegalArgumentException();
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user