Path: blob/master/test/functional/cmdline_options_testresources/src/WithoutDebugInfo.java
6004 views
/*******************************************************************************1* Copyright (c) 2001, 2018 IBM Corp. and others2*3* This program and the accompanying materials are made available under4* the terms of the Eclipse Public License 2.0 which accompanies this5* distribution and is available at https://www.eclipse.org/legal/epl-2.0/6* or the Apache License, Version 2.0 which accompanies this distribution and7* is available at https://www.apache.org/licenses/LICENSE-2.0.8*9* This Source Code may also be made available under the following10* Secondary Licenses when the conditions for such availability set11* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU12* General Public License, version 2 with the GNU Classpath13* Exception [1] and GNU General Public License, version 2 with the14* OpenJDK Assembly Exception [2].15*16* [1] https://www.gnu.org/software/classpath/license.html17* [2] http://openjdk.java.net/legal/assembly-exception.html18*19* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception20*******************************************************************************/21/**22* Source Control Header23*24* $Author: fengj $25* $Date: 2012/11/23 21:12:03 $26* $Revision: 1.2 $27* $Name: $28* $Log: WithoutDebugInfo.java,v $29* Revision 1.2 2012/11/23 21:12:03 fengj30* JAZZ 60879 : : fix copyright notices in HEAD for Java 8 beta 201231*32* Revision 1.1 2012/03/21 14:33:07 lanxia33* Jazz 54452:Jason Feng & Ronald Servant: move cmdline_options_testresources from javasvt to ottcvs134*35* Revision 1.1 2007-11-06 16:51:00 vsebe36* Created for new build system implementation (Hudson). Project contains old cmdline_options_tester/testresources module.37*38* Revision 1.1 2006/02/16 00:44:03 rajeev_rattehall39* Initial check in40*41*42*/4344/*45* Created on Oct 14, 200446*47*/4849import java.io.IOException;5051public class WithoutDebugInfo {52public static void main( String[] args ) throws Exception {53switch (Integer.parseInt( args[0] )) {54case 1:55case 2:56System.out.println("OK");57break;58case 3:59case 4:60// Runtime exception61Object nullObj = null;62System.out.println( nullObj.toString() );63break;64case 5:65case 6:66// Declared exception67throw new IOException();68case 7:69case 8:70// Print a stack trace, but then exit normally71new Exception().printStackTrace();72break;73case 9:74case 10:75// Stacktrace contains some unknown code, some known code76WithDebugInfo.main( new String[] { "3" } );77break;78case 11:79case 12:80// Stacktrace contains some unknown code, some known code81WithDebugInfo.main( new String[] { "5" } );82break;83case 13:84case 14:85// Stacktrace contains some unknown code, some known code86WithDebugInfo.main( new String[] { "7" } );87break;88}89}90}919293