test/langtools/tools/javac/multicatch/Neg01eff_final.java
author darcy
Fri, 02 Feb 2018 10:29:25 -0800
changeset 48723 6cb86bf0b51e
parent 47216 71c04702a3d5
child 50949 999f09bf3464
permissions -rw-r--r--
8196623: Update JavaBaseTest.java to be version agnostic Reviewed-by: vromero

/*
 * @test /nodynamiccopyright/
 * @bug 6943289
 *
 * @summary Project Coin: Improved Exception Handling for Java (aka 'multicatch')
 * @author darcy
 * @compile/fail/ref=Neg01eff_final.out -XDrawDiagnostics Neg01eff_final.java
 * @compile -source 6 -XDrawDiagnostics Neg01eff_final.java
 *
 */

class Neg01eff_final {
    static class A extends Exception {}
    static class B1 extends A {}
    static class B2 extends A {}

    class Test {
        void m() throws A {
            try {
                throw new B1();
            } catch (A ex1) {
                try {
                    throw ex1; // used to throw A, now throws B1!
                } catch (B2 ex2) { }//unreachable
            }
        }
    }
}