mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
Java control flow: Fixed false positive for unreachable code in multi-catch clause (IDEA-138978)
This commit is contained in:
+22
@@ -0,0 +1,22 @@
|
||||
class MultiCatch {
|
||||
|
||||
public String get(boolean b) {
|
||||
try {
|
||||
return b ? get1() : get2();
|
||||
} catch (EE1 | EE2 e) {
|
||||
return null; // is reachable
|
||||
} catch (E1 | E2 e) {
|
||||
//
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
String get1() throws E1 { return "1"; }
|
||||
String get2() throws E2 { return "2"; }
|
||||
|
||||
static class E extends Exception { }
|
||||
static class E1 extends E { }
|
||||
static class E2 extends E { }
|
||||
static class EE1 extends E1 { }
|
||||
static class EE2 extends E2 { }
|
||||
}
|
||||
Reference in New Issue
Block a user