mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-04 20:30:42 +07:00
- code-block should not be added when lifting throw out of switch makes throw statement the only one inside 'then' clause - code-block should be added when lifting throw out of switch which is nested inside multiple variable declaration which is nested as the only statement of 'then' clause that does not have braces Merge-request: IJ-MR-173629 Merged-by: Marcin Mikosik <marcin.mikosik@jetbrains.com> GitOrigin-RevId: 5644e3dfee807c22eae75d3536fbb9af5ece5eca
17 lines
374 B
Java
17 lines
374 B
Java
// "Lift 'throw' out of 'switch' expression" "true-preview"
|
|
|
|
public class Foo {
|
|
public int bar(int param) {
|
|
if (param==2) {
|
|
int x = 3;
|
|
throw switch (param) {
|
|
default -> new ArithmeticException();
|
|
};
|
|
} else {
|
|
return 1;
|
|
}
|
|
}
|
|
public int call(int param) {
|
|
return 3;
|
|
}
|
|
} |