mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
Multi-catch support: exceptions may implement interfaces
This commit is contained in:
+5
@@ -5,14 +5,19 @@ abstract class C {
|
||||
private static class E2 extends E { }
|
||||
private static class E3 extends E { }
|
||||
private static class RE extends RuntimeException { }
|
||||
private interface I { }
|
||||
private static class IE1 extends E implements I { }
|
||||
private static class IE2 extends E implements I { }
|
||||
|
||||
abstract void f() throws E1, E2;
|
||||
abstract void g() throws IE1, IE2;
|
||||
|
||||
void m() {
|
||||
try { f(); } catch (E1 | E2 e) { }
|
||||
try { f(); } catch (E2 | E e) { e.printStackTrace(); }
|
||||
try { f(); } catch (E2 | E1 e) { } catch (E e) { } catch (RE e) { }
|
||||
try { f(); } catch (E1 | E e) { E ee = e; }
|
||||
try { g(); } catch (IE1 | IE2 e) { E ee = e; I ii = e; }
|
||||
|
||||
try { f(); } catch (E1 | E2 | <error descr="Exception 'C.E3' is never thrown in the corresponding try block">E3</error> e) { }
|
||||
try { f(); } catch (<error descr="Exception 'C.E3' is never thrown in the corresponding try block">E3</error> | E e) { }
|
||||
|
||||
Reference in New Issue
Block a user