Mon, 17 Nov 2014 12:40:43 -0800
Added tag jdk8u31-b09 for changeset 26c46688ce4a
aoqi@0 | 1 | /* |
aoqi@0 | 2 | * @test /nodynamiccopyright/ |
aoqi@0 | 3 | * @bug 7030606 |
aoqi@0 | 4 | * |
aoqi@0 | 5 | * @summary Project-coin: multi-catch types should be pairwise disjoint |
aoqi@0 | 6 | * @compile/fail/ref=T7030606.out -XDrawDiagnostics T7030606.java |
aoqi@0 | 7 | */ |
aoqi@0 | 8 | |
aoqi@0 | 9 | class T7030606 { |
aoqi@0 | 10 | class E1 extends Exception { } |
aoqi@0 | 11 | class E2 extends E1 { } |
aoqi@0 | 12 | |
aoqi@0 | 13 | void e1() throws E1 { } |
aoqi@0 | 14 | void e2() throws E2 { } |
aoqi@0 | 15 | |
aoqi@0 | 16 | void m1() { |
aoqi@0 | 17 | try { |
aoqi@0 | 18 | e1(); |
aoqi@0 | 19 | e2(); |
aoqi@0 | 20 | } catch (NonExistentType | E2 | E1 e) { } |
aoqi@0 | 21 | } |
aoqi@0 | 22 | |
aoqi@0 | 23 | void m2() { |
aoqi@0 | 24 | try { |
aoqi@0 | 25 | e1(); |
aoqi@0 | 26 | e2(); |
aoqi@0 | 27 | } catch (NonExistentType | E1 | E2 e) { } |
aoqi@0 | 28 | } |
aoqi@0 | 29 | |
aoqi@0 | 30 | void m3() { |
aoqi@0 | 31 | try { |
aoqi@0 | 32 | e1(); |
aoqi@0 | 33 | e2(); |
aoqi@0 | 34 | } catch (E2 | NonExistentType | E1 e) { } |
aoqi@0 | 35 | } |
aoqi@0 | 36 | |
aoqi@0 | 37 | void m4() { |
aoqi@0 | 38 | try { |
aoqi@0 | 39 | e1(); |
aoqi@0 | 40 | e2(); |
aoqi@0 | 41 | } catch (E1 | NonExistentType | E2 e) { } |
aoqi@0 | 42 | } |
aoqi@0 | 43 | |
aoqi@0 | 44 | void m5() { |
aoqi@0 | 45 | try { |
aoqi@0 | 46 | e1(); |
aoqi@0 | 47 | e2(); |
aoqi@0 | 48 | } catch (E2 | E1 | NonExistentType e) { } |
aoqi@0 | 49 | } |
aoqi@0 | 50 | |
aoqi@0 | 51 | void m6() { |
aoqi@0 | 52 | try { |
aoqi@0 | 53 | e1(); |
aoqi@0 | 54 | e2(); |
aoqi@0 | 55 | } catch (E1 | E2 | NonExistentType e) { } |
aoqi@0 | 56 | } |
aoqi@0 | 57 | } |