Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jdb/locals/locals002/locals002a.java
40951 views
/*1* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223// THIS TEST IS LINE NUMBER SENSITIVE2425package nsk.jdb.locals.locals002;2627import nsk.share.*;28import nsk.share.jpda.*;29import nsk.share.jdb.*;3031import java.io.*;3233/* This is debuggee aplication */34public class locals002a {35static locals002a _locals002a = new locals002a();3637public static void main(String args[]) {38System.exit(locals002.JCK_STATUS_BASE + _locals002a.runIt(args, System.out));39}4041static void lastBreak () {}4243public int runIt(String args[], PrintStream out) {44JdbArgumentHandler argumentHandler = new JdbArgumentHandler(args);45Log log = new Log(out, argumentHandler);4647int arr[] = new int[3];4849for (int i = 0 ; i < 3 ; i++) arr[i] = i*i;5051allKindsOfVars (52false,53(byte)12,54'A',55(short)327,563647,57(long)65789,58(float)4.852,59(double)3.8976,60"objArgString",61arr62);6364allKindsOfLocals();6566log.display("Debuggee PASSED");67return locals002.PASSED;68}6970public void allKindsOfVars (71boolean boolVar,72byte byteVar,73char charVar,74short shortVar,75int intVar,76long longVar,77float floatVar,78double doubleVar,79Object objVar,80int[] arrVar81)82{83int x = 3; // locals002.BREAKPOINT_LINE184}8586static void allKindsOfLocals() {87boolean boolVar = true;88byte byteVar = 27;89char charVar = 'V';90short shortVar = (short)767;91int intVar = 1474;92long longVar = (long)21345;93float floatVar = (float)3.141;94double doubleVar = (double)2.578;95Object objVar = "objVarString";96int[] arrVar = new int[5];9798for (int j = 0; j < 5 ; j++) arrVar[j] = j;99int x = 4; // locals002.BREAKPOINT_LINE2100}101}102103104