Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jdb/unwatch/unwatch001/unwatch001a.java
40951 views
/*1* Copyright (c) 2002, 2021, 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.jdb.unwatch.unwatch001;2425import nsk.share.*;26import nsk.share.jpda.*;27import nsk.share.jdb.*;2829import java.io.*;3031/* This is debuggee aplication */32public class unwatch001a {33/* TEST DEPENDANT VARIABLES AND CONSTANTS */34static final String PACKAGE_NAME = "nsk.jdb.unwatch.unwatch001";3536public static void main(String args[]) {37unwatch001a _unwatch001a = new unwatch001a();38System.exit(unwatch001.JCK_STATUS_BASE + _unwatch001a.runIt(args, System.out));39}4041static void breakHere () {}4243public int runIt(String args[], PrintStream out) {44JdbArgumentHandler argumentHandler = new JdbArgumentHandler(args);45Log log = new Log(out, argumentHandler);4647breakHere();48updateFields(false);49fields.updateFields(false);5051breakHere();52updateFields(false);53fields.updateFields(false);5455log.display("Debuggee PASSED");56return unwatch001.PASSED;57}5859static boolean fS0, fS1[], fS2[][];60static Boolean FS0, FS1[], FS2[][];6162interface Inter {}63Inter I0, I1[], I2[][];6465// assign new values to fields66void updateFields(boolean flag) {6768fS0 = flag ? fS0 : false;69fS1 = flag ? fS1 : new boolean[] {fS0};70fS2 = flag ? fS2 : new boolean[][] {fS1};7172FS0 = flag ? FS0 : Boolean.valueOf(false);73FS1 = flag ? FS1 : new Boolean[] {FS0};74FS2 = flag ? FS2 : new Boolean[][] {FS1};7576I0 = flag ? I0 : new CheckedFields();77I1 = flag ? I1 : new CheckedFields[] {new CheckedFields()};78I2 = flag ? I2 : new CheckedFields[][] {new CheckedFields[] {new CheckedFields()}};79}8081class CheckedFields implements Inter {8283private byte fP0, fP1[], fP2[][];84public char fU0, fU1[], fU2[][];85protected double fR0, fR1[], fR2[][];86transient float fT0, fT1[], fT2[][];87volatile long fV0, fV1[], fV2[][];8889private Byte FP0, FP1[], FP2[][];90public Character FU0, FU1[], FU2[][];91protected Double FR0, FR1[], FR2[][];92transient Float FT0, FT1[], FT2[][];93volatile Long FV0, FV1[], FV2[][];9495// assign new values to fields96void updateFields(boolean flag) {9798fP0 = flag ? fP0 : Byte.MIN_VALUE ;99fU0 = flag ? fU0 : Character.MIN_VALUE;100fR0 = flag ? fR0 : Double.MIN_VALUE;101fT0 = flag ? fT0 : Float.MIN_VALUE;102fV0 = flag ? fV0 : Integer.MIN_VALUE;103104FP0 = flag ? FP0 : Byte.valueOf(Byte.MIN_VALUE) ;105FU0 = flag ? FU0 : Character.valueOf(Character.MIN_VALUE);106FR0 = flag ? FR0 : Double.valueOf(Double.MIN_VALUE);107FT0 = flag ? FT0 : Float.valueOf(Float.MIN_VALUE);108FV0 = flag ? FV0 : Long.valueOf(Long.MIN_VALUE);109110fP1 = flag ? fP1 : new byte[] {fP0};111fP2 = flag ? fP2 : new byte[][] {fP1};112fU1 = flag ? fU1 : new char[] {fU0};113fU2 = flag ? fU2 : new char[][] {fU1};114fR1 = flag ? fR1 : new double[] {fR0};115fR2 = flag ? fR2 : new double[][] {fR1};116fT1 = flag ? fT1 : new float[] {fT0};117fT2 = flag ? fT2 : new float[][] {fT1};118fV1 = flag ? fV1 : new long[] {fV0};119fV2 = flag ? fV2 : new long[][] {fV1};120121FP1 = flag ? FP1 : new Byte[] {FP0};122FP2 = flag ? FP2 : new Byte[][] {FP1};123FU1 = flag ? FU1 : new Character[] {FU0};124FU2 = flag ? FU2 : new Character[][] {FU1};125FR1 = flag ? FR1 : new Double[] {FR0};126FR2 = flag ? FR2 : new Double[][] {FR1};127FT1 = flag ? FT1 : new Float[] {FT0};128FT2 = flag ? FT2 : new Float[][] {FT1};129FV1 = flag ? FV1 : new Long[] {FV0};130FV2 = flag ? FV2 : new Long[][] {FV1};131}132}133134CheckedFields fields;135136public unwatch001a() {137fields = new CheckedFields();138}139}140141142