Mon, 21 Jan 2013 11:16:28 -0800
Merge
mcimadamore@550 | 1 | /* |
ohair@554 | 2 | * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. |
mcimadamore@550 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
mcimadamore@550 | 4 | * |
mcimadamore@550 | 5 | * This code is free software; you can redistribute it and/or modify it |
mcimadamore@550 | 6 | * under the terms of the GNU General Public License version 2 only, as |
mcimadamore@550 | 7 | * published by the Free Software Foundation. |
mcimadamore@550 | 8 | * |
mcimadamore@550 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
mcimadamore@550 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
mcimadamore@550 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
mcimadamore@550 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
mcimadamore@550 | 13 | * accompanied this code). |
mcimadamore@550 | 14 | * |
mcimadamore@550 | 15 | * You should have received a copy of the GNU General Public License version |
mcimadamore@550 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
mcimadamore@550 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
mcimadamore@550 | 18 | * |
ohair@554 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
ohair@554 | 20 | * or visit www.oracle.com if you need additional information or have any |
ohair@554 | 21 | * questions. |
mcimadamore@550 | 22 | */ |
mcimadamore@550 | 23 | |
mcimadamore@550 | 24 | /* |
mcimadamore@550 | 25 | * @test |
mcimadamore@550 | 26 | * @bug 6943289 |
mcimadamore@550 | 27 | * @summary Project Coin: Improved Exception Handling for Java (aka 'multicatch') |
mcimadamore@550 | 28 | * @compile Pos03.java |
mcimadamore@550 | 29 | */ |
mcimadamore@550 | 30 | |
mcimadamore@550 | 31 | class Pos03 { |
mcimadamore@550 | 32 | |
mcimadamore@550 | 33 | static class A extends Exception { public void m() {}; public Object f;} |
mcimadamore@550 | 34 | static class B1 extends A {} |
mcimadamore@550 | 35 | static class B2 extends A {} |
mcimadamore@550 | 36 | |
mcimadamore@550 | 37 | void m() { |
mcimadamore@550 | 38 | try { |
mcimadamore@550 | 39 | if (true) { |
mcimadamore@550 | 40 | throw new B1(); |
mcimadamore@550 | 41 | } |
mcimadamore@550 | 42 | else { |
mcimadamore@550 | 43 | throw new B2(); |
mcimadamore@550 | 44 | } |
mcimadamore@550 | 45 | } catch (final B1 | B2 ex) { |
mcimadamore@550 | 46 | ex.m(); |
mcimadamore@550 | 47 | System.out.println(ex.f); |
mcimadamore@550 | 48 | } |
mcimadamore@550 | 49 | } |
mcimadamore@550 | 50 | } |