Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jdi/Accessible/modifiers/modifiers001a.java
41161 views
/*1* Copyright (c) 2000, 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.jdi.Accessible.modifiers;2425import nsk.share.*;26import nsk.share.jpda.*;27import nsk.share.jdi.*;282930/**31* This class is used as debugee application for the modifiers001 JDI test.32*/3334public class modifiers001a {3536static boolean verbose_mode = false;3738// Classes must be loaded and linked, so all fields must be39// initialized40Boolean Z0 = Boolean.valueOf(false);41Byte B0 = Byte.valueOf((byte)1);42Character C0 = Character.valueOf('c');43Double D0 = Double.valueOf(1);44Float F0 = Float.valueOf(1);45Integer I0 = Integer.valueOf(1);46Long L0 = Long.valueOf(1);47String S0 = new String("s");48Object O0 = new Object();4950modifiers001 m001_0=new modifiers001();51modifiers001a m001a_0, m001a_1[] = {m001a_0};5253final static class fin_s_cls {}54abstract static class abs_s_cls {}55static class abs_s_cls_ext extends abs_s_cls {}56static interface s_interf {}57static class s_interf_impl implements s_interf {}5859// Interfaces and abstract classes must be loaded and linked, so classes60// that implement interfaces and extend abstract classes must be61// initialized62fin_s_cls fin_s_cls_0 = new fin_s_cls();63abs_s_cls_ext abs_s_cls_ext_0 = new abs_s_cls_ext();64abs_s_cls abs_s_cls_0, abs_s_cls_1[] = {abs_s_cls_0};65s_interf_impl s_interf_impl_0 = new s_interf_impl();66s_interf s_interf_0, s_interf_1[] = {s_interf_0};6768simple_class m_simpleclass_0 = new simple_class();69abstract_class_ext m_absclass_ext_0 = new abstract_class_ext();70abstract_class m_absclass_0, m_absclass_1[] = {m_absclass_0};71final_class m_finclass_0 = new final_class();72interf_impl m_interf_impl_0 = new interf_impl();73interf m_interf_0, m_interf_1[] = {m_interf_0};7475private static void print_log_on_verbose(String message) {76if ( verbose_mode ) {77System.err.println(message);78}79}8081public static void main (String argv[]) {8283for (int i=0; i<argv.length; i++) {84if ( argv[i].equals("-vbs") || argv[i].equals("-verbose") ) {85verbose_mode = true;86break;87}88}8990print_log_on_verbose("**> modifiers001a: debugee started!");91modifiers001a obj = new modifiers001a();92ArgumentHandler argHandler = new ArgumentHandler(argv);93IOPipe pipe = argHandler.createDebugeeIOPipe();94print_log_on_verbose("**> modifiers001a: waiting for \"quit\" signal...");95pipe.println("ready");96String instruction = pipe.readln();97if (instruction.equals("quit")) {98print_log_on_verbose("**> modifiers001a: \"quit\" signal recieved!");99print_log_on_verbose("**> modifiers001a: completed succesfully!");100System.exit(0/*STATUS_PASSED*/ + 95/*STATUS_TEMP*/);101}102System.err.println("!!**> modifiers001a: unexpected signal (no \"quit\") - " + instruction);103System.err.println("!!**> modifiers001a: FAILED!");104System.exit(2/*STATUS_FAILED*/ + 95/*STATUS_TEMP*/);105}106}107108/** simple class */109class simple_class {}110111/** abstract class */112abstract class abstract_class {}113114/** Class that extends abstract class */115class abstract_class_ext extends abstract_class {}116117/** final class */118final class final_class {}119120/** simple interface */121interface interf {}122123/** Class that implements interface */124class interf_impl implements interf {}125126127