Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jdb/watch/watch002/watch002a.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.watch.watch002;2425import nsk.share.*;26import nsk.share.jpda.*;27import nsk.share.jdb.*;2829import java.io.*;3031/* This is debuggee aplication */32public class watch002a {33/* TEST DEPENDANT VARIABLES AND CONSTANTS */34static final String PACKAGE_NAME = "nsk.jdb.watch.watch002";3536public static void main(String args[]) {37watch002a _watch002a = new watch002a();38System.exit(watch002.JCK_STATUS_BASE + _watch002a.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);5051log.display("Debuggee PASSED");52return watch002.PASSED;53}5455static boolean fS0, fS1[], fS2[][];56static Boolean FS0, FS1[], FS2[][];5758interface Inter {}59Inter I0, I1[], I2[][];6061// assign new values to fields62void updateFields(boolean flag) {6364fS0 = flag ? fS0 : false;65fS1 = flag ? fS1 : new boolean[] {fS0};66fS2 = flag ? fS2 : new boolean[][] {fS1};6768FS0 = flag ? FS0 : Boolean.valueOf(false);69FS1 = flag ? FS1 : new Boolean[] {FS0};70FS2 = flag ? FS2 : new Boolean[][] {FS1};7172I0 = flag ? I0 : new CheckedFields();73I1 = flag ? I1 : new CheckedFields[] {new CheckedFields()};74I2 = flag ? I2 : new CheckedFields[][] {new CheckedFields[] {new CheckedFields()}};75}7677class CheckedFields implements Inter {7879private byte fP0, fP1[], fP2[][];80public char fU0, fU1[], fU2[][];81protected double fR0, fR1[], fR2[][];82transient float fT0, fT1[], fT2[][];83volatile long fV0, fV1[], fV2[][];8485private Byte FP0, FP1[], FP2[][];86public Character FU0, FU1[], FU2[][];87protected Double FR0, FR1[], FR2[][];88transient Float FT0, FT1[], FT2[][];89volatile Long FV0, FV1[], FV2[][];9091// assign new values to fields92void updateFields(boolean flag) {9394fP0 = flag ? fP0 : Byte.MIN_VALUE ;95fU0 = flag ? fU0 : Character.MIN_VALUE;96fR0 = flag ? fR0 : Double.MIN_VALUE;97fT0 = flag ? fT0 : Float.MIN_VALUE;98fV0 = flag ? fV0 : Integer.MIN_VALUE;99100FP0 = flag ? FP0 : Byte.valueOf(Byte.MIN_VALUE) ;101FU0 = flag ? FU0 : Character.valueOf(Character.MIN_VALUE);102FR0 = flag ? FR0 : Double.valueOf(Double.MIN_VALUE);103FT0 = flag ? FT0 : Float.valueOf(Float.MIN_VALUE);104FV0 = flag ? FV0 : Long.valueOf(Long.MIN_VALUE);105106fP1 = flag ? fP1 : new byte[] {fP0};107fP2 = flag ? fP2 : new byte[][] {fP1};108fU1 = flag ? fU1 : new char[] {fU0};109fU2 = flag ? fU2 : new char[][] {fU1};110fR1 = flag ? fR1 : new double[] {fR0};111fR2 = flag ? fR2 : new double[][] {fR1};112fT1 = flag ? fT1 : new float[] {fT0};113fT2 = flag ? fT2 : new float[][] {fT1};114fV1 = flag ? fV1 : new long[] {fV0};115fV2 = flag ? fV2 : new long[][] {fV1};116117FP1 = flag ? FP1 : new Byte[] {FP0};118FP2 = flag ? FP2 : new Byte[][] {FP1};119FU1 = flag ? FU1 : new Character[] {FU0};120FU2 = flag ? FU2 : new Character[][] {FU1};121FR1 = flag ? FR1 : new Double[] {FR0};122FR2 = flag ? FR2 : new Double[][] {FR1};123FT1 = flag ? FT1 : new Float[] {FT0};124FT2 = flag ? FT2 : new Float[][] {FT1};125FV1 = flag ? FV1 : new Long[] {FV0};126FV2 = flag ? FV2 : new Long[][] {FV1};127}128}129130CheckedFields fields;131132public watch002a() {133fields = new CheckedFields();134}135}136137138