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