test/tools/javac/diags/examples/UnreachableCatch1.java

Wed, 06 Apr 2011 20:33:44 -0700

author
ohair
date
Wed, 06 Apr 2011 20:33:44 -0700
changeset 962
0ff2bbd38f10
parent 935
5b29f2a85085
child 990
9a847a77205d
permissions
-rw-r--r--

7033660: Update copyright year to 2011 on any files changed in 2011
Reviewed-by: dholmes

mcimadamore@935 1 /*
mcimadamore@935 2 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
mcimadamore@935 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
mcimadamore@935 4 *
mcimadamore@935 5 * This code is free software; you can redistribute it and/or modify it
mcimadamore@935 6 * under the terms of the GNU General Public License version 2 only, as
mcimadamore@935 7 * published by the Free Software Foundation.
mcimadamore@935 8 *
mcimadamore@935 9 * This code is distributed in the hope that it will be useful, but WITHOUT
mcimadamore@935 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
mcimadamore@935 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
mcimadamore@935 12 * version 2 for more details (a copy is included in the LICENSE file that
mcimadamore@935 13 * accompanied this code).
mcimadamore@935 14 *
mcimadamore@935 15 * You should have received a copy of the GNU General Public License version
mcimadamore@935 16 * 2 along with this work; if not, write to the Free Software Foundation,
mcimadamore@935 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
mcimadamore@935 18 *
mcimadamore@935 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
mcimadamore@935 20 * or visit www.oracle.com if you need additional information or have any
mcimadamore@935 21 * questions.
mcimadamore@935 22 */
mcimadamore@935 23
mcimadamore@935 24 // key: compiler.warn.unreachable.catch.1
mcimadamore@935 25
mcimadamore@935 26 class UnreachableCatch1 {
mcimadamore@935 27
mcimadamore@935 28 void test() {
mcimadamore@935 29 try {
mcimadamore@935 30 throw new IllegalArgumentException();
mcimadamore@935 31 }
mcimadamore@935 32 catch(Error err) { }
mcimadamore@935 33 catch(RuntimeException rex) { }
mcimadamore@935 34 catch(Throwable t) { } //unreachable
mcimadamore@935 35 }
mcimadamore@935 36 }

mercurial