OnThrowTarget.java revision 2362
98ea99a9d0a5253440a949279650e7d229051ee7James Phillpotts/*
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * This code is free software; you can redistribute it and/or modify it
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * under the terms of the GNU General Public License version 2 only, as
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * published by the Free Software Foundation.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * This code is distributed in the hope that it will be useful, but WITHOUT
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * version 2 for more details (a copy is included in the LICENSE file that
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * accompanied this code).
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * You should have received a copy of the GNU General Public License version
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * 2 along with this work; if not, write to the Free Software Foundation,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * or visit www.oracle.com if you need additional information or have any
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * questions.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
98ea99a9d0a5253440a949279650e7d229051ee7James Phillpottsclass OnThrowException extends Exception {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private String myname = "OnThrowException";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster}
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
26304a2a091af368cfc16c977bcce6d17195360aTom Rumseypublic class OnThrowTarget extends Thread {
ccf9d4a5c6453fa9f8b839baeee25147865fbb7dJames Phillpotts static void doThrow() throws OnThrowException {
6f4585ccfd5c6dac45cc93a0110ea8ad255315ffNeil Madden System.out.println( "target doing throw");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throw new OnThrowException();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
6f4585ccfd5c6dac45cc93a0110ea8ad255315ffNeil Madden public static void main( final String[] args ) throws OnThrowException {
6f4585ccfd5c6dac45cc93a0110ea8ad255315ffNeil Madden System.out.println( "start of target main" );
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster doThrow();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /* No catch */
2cdbc4fc62ed8b9c2c8ef660adc4fe0188b65407Neil Madden }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster}
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster