Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jdi/ArrayReference/getValue/getvalue003a.java
41161 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*/2223package nsk.jdi.ArrayReference.getValue;2425import nsk.share.*;26import nsk.share.jpda.*;27import nsk.share.jdi.*;282930public class getvalue003a {3132public final static String[] NON_INIT_FIELDS = {"staticIntArr2C",33"staticIntArrC",34"staticObjArrC"};3536static getvalue003aClassToCheck testedObj = new getvalue003aClassToCheck();373839public static void main (String argv[]) {4041ArgumentHandler argHandler = new ArgumentHandler(argv);42Log log = new Log(System.err, argHandler);43IOPipe pipe = argHandler.createDebugeeIOPipe(log);44pipe.println("ready");4546String instruction = pipe.readln();4748if ( instruction.equals("quit") ) {49log.display("DEBUGEE> \"quit\" signal recieved.");50log.display("DEBUGEE> completed succesfully.");51System.exit(getvalue003.TEST_PASSED + getvalue003.JCK_STATUS_BASE);52}53log.complain("DEBUGEE FAILURE> unexpected signal "54+ "(no \"quit\") - " + instruction);55log.complain("DEBUGEE FAILURE> TEST FAILED");56System.exit(getvalue003.TEST_FAILED + getvalue003.JCK_STATUS_BASE);57}58}5960class getvalue003aClassToCheck {61static int[] staticIntArr = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};62static Object[] staticObjArr = {null, null, null, null, null, null, null, null, null, null};6364static int[][] staticIntArr2 = {{0, 1, 2, 3, 4, 5, 6, 7, 8, 9},65{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}};6667static int[][] staticIntArr2C; // not initialized6869static int[] staticIntArrC; // not initialized70public int[] publicIntArrC;71protected int[] protecIntArrC;72private int[] privatIntArrC;7374static Object[] staticObjArrC; // not initialized75public Object[] publicObjArrC;76protected Object[] protecObjArrC;77private Object[] privatObjArrC;7879public getvalue003aClassToCheck() {80publicIntArrC = createIntArray();81protecIntArrC = createIntArray();82privatIntArrC = createIntArray();8384publicObjArrC = createObjArray();85protecObjArrC = createObjArray();86privatObjArrC = createObjArray();87}8889static private int[] createIntArray() {90int[] array = new int[10];91for ( int i = 0; i < 10; i++ ) array[i] = i;92return array;93}9495static private Object[] createObjArray() {96Object[] array = new Object[10];97return array;98}99100}101102103