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=Neg03.out -XDrawDiagnostics Neg03.java mcimadamore@550: * mcimadamore@550: */ mcimadamore@550: mcimadamore@550: class Neg03 { mcimadamore@550: mcimadamore@735: static class A extends Exception { public void m() {}; public Object f;} mcimadamore@735: static class B1 extends A {} mcimadamore@735: static class B2 extends A {} mcimadamore@735: mcimadamore@735: void m() throws B1, B2 { mcimadamore@550: try { mcimadamore@550: if (true) { mcimadamore@735: throw new B1(); mcimadamore@550: } mcimadamore@550: else { mcimadamore@735: throw new B2(); mcimadamore@550: } mcimadamore@735: } catch (Exception ex) { mcimadamore@735: ex = new B2(); //effectively final analysis disabled! mcimadamore@735: throw ex; mcimadamore@550: } mcimadamore@550: } mcimadamore@550: }