Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassObjectReference/toString/tostring001a.java
41161 views
1
/*
2
* Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation.
8
*
9
* This code is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12
* version 2 for more details (a copy is included in the LICENSE file that
13
* accompanied this code).
14
*
15
* You should have received a copy of the GNU General Public License version
16
* 2 along with this work; if not, write to the Free Software Foundation,
17
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18
*
19
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20
* or visit www.oracle.com if you need additional information or have any
21
* questions.
22
*/
23
24
package nsk.jdi.ClassObjectReference.toString;
25
26
import nsk.share.*;
27
import nsk.share.jpda.*;
28
import nsk.share.jdi.*;
29
30
// THIS TEST IS LINE NUMBER SENSITIVE
31
32
/**
33
* The debugged applcation of the test.
34
*/
35
public class tostring001a {
36
37
//------------------------------------------------------- immutable common fields
38
39
private static int exitStatus;
40
private static ArgumentHandler argHandler;
41
private static Log log;
42
private static IOPipe pipe;
43
44
//------------------------------------------------------- immutable common methods
45
46
static void display(String msg) {
47
log.display("debuggee > " + msg);
48
}
49
50
static void complain(String msg) {
51
log.complain("debuggee FAILURE > " + msg);
52
}
53
54
public static void receiveSignal(String signal) {
55
String line = pipe.readln();
56
57
if ( !line.equals(signal) )
58
throw new Failure("UNEXPECTED debugger's signal " + line);
59
60
display("debuger's <" + signal + "> signal received.");
61
}
62
63
//------------------------------------------------------ mutable common fields
64
65
//------------------------------------------------------ test specific fields
66
67
public final static String brkpMethodName = "main";
68
public final static int brkpLineNumber = 121;
69
70
// Classes must be loaded and linked, so all fields must be
71
// initialized
72
Boolean Z0 = Boolean.valueOf(true), Z1[]={Z0}, Z2[][]={Z1};
73
Byte B0 = Byte.valueOf((byte)1), B1[]={B0}, B2[][]={B1};
74
Character C0 = Character.valueOf('\u00ff'), C1[]={C0}, C2[][]={C1};
75
Double D0 = Double.valueOf(1.0), D1[]={D0}, D2[][]={D1};
76
Float F0 = Float.valueOf(1.0f), F1[]={F0}, F2[][]={F1};
77
Integer I0 = Integer.valueOf(-1), I1[]={I0}, I2[][]={I1};
78
Long L0 = Long.valueOf(-1l), L1[]={L0}, L2[][]={L1};
79
Short H0 = Short.valueOf((short)-1), H1[]={H0}, H2[][]={H1};
80
String S0 = new String("4434819"), S1[]={S0}, S2[][]={S1};
81
Object O0 = new Object(), O1[]={O0}, O2[][]={O1};
82
83
// Interfaces must be loaded and linked, so classes that implement
84
// interfaces must be initialized.
85
static class innerClass {}
86
static interface innerInterf {}
87
protected static class innerInterfImpl implements innerInterf {}
88
innerInterfImpl sii0 = new innerInterfImpl();
89
90
innerClass innerClass0 = new innerClass();
91
innerClass innerClass1[] = {innerClass0};
92
innerClass innerClass2[][] = {innerClass1};
93
94
innerInterf innerInterf0;
95
innerInterf innerInterf1[] = {innerInterf0};
96
innerInterf innerInterf2[][] = {innerInterf1};
97
98
tostring001aClass tostring001aClass0 = new tostring001aClass();
99
tostring001aClass tostring001aClass1[] = {tostring001aClass0};
100
tostring001aClass tostring001aClass2[][] = {tostring001aClass1};
101
102
class tostring001aInterfImpl implements tostring001aInterf {}
103
tostring001aInterfImpl pii0 = new tostring001aInterfImpl();
104
tostring001aInterf tostring001aInterf0;
105
tostring001aInterf tostring001aInterf1[] = {tostring001aInterf0};
106
tostring001aInterf tostring001aInterf2[][] = {tostring001aInterf1};
107
108
//------------------------------------------------------ mutable common method
109
110
public static void main (String argv[]) {
111
exitStatus = Consts.TEST_FAILED;
112
argHandler = new ArgumentHandler(argv);
113
log = new Log(System.err, argHandler);
114
pipe = argHandler.createDebugeeIOPipe(log);
115
116
tostring001a dummy = new tostring001a();
117
118
try {
119
pipe.println(tostring001.SIGNAL_READY);
120
receiveSignal(tostring001.SIGNAL_GO);
121
log.display("breakpoint line"); // brkpLineNumber
122
receiveSignal(tostring001.SIGNAL_QUIT);
123
display("completed succesfully.");
124
System.exit(Consts.TEST_PASSED + Consts.JCK_STATUS_BASE);
125
} catch (Failure e) {
126
log.complain(e.getMessage());
127
System.exit(Consts.TEST_FAILED + Consts.JCK_STATUS_BASE);
128
}
129
}
130
131
//--------------------------------------------------------- test specific methods
132
}
133
134
//--------------------------------------------------------- test specific classes
135
class tostring001aClass {}
136
interface tostring001aInterf {}
137
138