aoqi@0: /* aoqi@0: * @test /nodynamiccopyright/ aoqi@0: * @bug 6943289 6993963 aoqi@0: * aoqi@0: * @summary Project Coin: Improved Exception Handling for Java (aka 'multicatch') aoqi@0: * @author mcimadamore aoqi@0: * @compile/fail/ref=Neg02eff_final.out -XDrawDiagnostics Neg02eff_final.java aoqi@0: * aoqi@0: */ aoqi@0: aoqi@0: class Neg02eff_final { aoqi@0: static class A extends Exception {} aoqi@0: static class B extends Exception {} aoqi@0: aoqi@0: void m() { aoqi@0: try { aoqi@0: if (true) { aoqi@0: throw new A(); aoqi@0: } aoqi@0: else { aoqi@0: throw new B(); aoqi@0: } aoqi@0: } catch (A | B ex) { aoqi@0: ex = new B(); aoqi@0: } aoqi@0: } aoqi@0: }