mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-04 20:30:42 +07:00
Adds a quick-fix: "Lift 'throw' out of 'switch' expression" that that is provided for error "'switch' expression does not have any result expressions". Some rare cases are not handled (fix is not provided for mentioned error). For example when switch is used inside: - initialization/condition/update part of for loop - initializer of class field - condition of do-while loop - lock expression in synchronized statement - any part of assert statement - resource initializer of 'try' statement #IDEA-283208 Fixed Merge-request: IJ-MR-172146 Merged-by: Marcin Mikosik <marcin.mikosik@jetbrains.com> GitOrigin-RevId: a2710c49e16b7f495974fb167bcae01b3d850f7b
17 lines
388 B
Java
17 lines
388 B
Java
// "Lift 'throw' out of 'switch' expression" "true-preview"
|
|
|
|
class Foo {
|
|
void bar(int param) {
|
|
a(1);
|
|
b(2);
|
|
throw <caret>switch (param) {
|
|
default -> new RuntimeException("default");
|
|
};
|
|
}
|
|
void parentMethod(int x, int y, int z) {}
|
|
int nestedMethod(int x, int y, int z) {}
|
|
void a(int x) {}
|
|
void b(int x) {}
|
|
void c(int x) {}
|
|
void d(int x) {}
|
|
} |