Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jdi/Accessible/isProtected/isProtected001a.java
41161 views
1
/*
2
* Copyright (c) 2000, 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.Accessible.isProtected;
25
26
import nsk.share.*;
27
import nsk.share.jpda.*;
28
import nsk.share.jdi.*;
29
30
31
/**
32
* This class is used as debugee application for the isProtected001 JDI test.
33
*/
34
35
public class isProtected001a {
36
37
static boolean verbose_mode = false;
38
39
boolean z0, z1[]={z0}, z2[][]={z1};
40
byte b0, b1[]={b0}, b2[][]={b1};
41
char c0, c1[]={c0}, c2[][]={c1};
42
double d0, d1[]={d0}, d2[][]={d1};
43
float f0, f1[]={f0}, f2[][]={f1};
44
int i0, i1[]={i0}, i2[][]={i1};
45
long l0, l1[]={l0}, l2[][]={l1};
46
47
// Classes must be loaded and linked, so all fields must be
48
// initialized
49
Boolean Z0 = Boolean.valueOf(true), Z1[]={Z0}, Z2[][]={Z1};
50
Byte B0 = Byte.valueOf((byte)1), B1[]={B0}, B2[][]={B1};
51
Character C0 = Character.valueOf('\u00ff'), C1[]={C0}, C2[][]={C1};
52
Double D0 = Double.valueOf(1.0), D1[]={D0}, D2[][]={D1};
53
Float F0 = Float.valueOf(1.0f), F1[]={F0}, F2[][]={F1};
54
Integer I0 = Integer.valueOf(-1), I1[]={I0}, I2[][]={I1};
55
Long L0 = Long.valueOf(-1l), L1[]={L0}, L2[][]={L1};
56
String S0 = new String("4434819"), S1[]={S0}, S2[][]={S1};
57
Object O0 = new Object(), O1[]={O0}, O2[][]={O1};
58
59
private static class U {}
60
protected static class V {}
61
public static class W {}
62
static class P {} // package private
63
64
U u0=new U(), u1[]={u0}, u2[][]={u1};
65
V v0=new V(), v1[]={v0}, v2[][]={v1};
66
W w0=new W(), w1[]={w0}, w2[][]={w1};
67
P p0=new P(), p1[]={p0}, p2[][]={p1};
68
69
// Interfaces must be loaded and linked, so classes that implement
70
// interfaces must be initialized.
71
protected static interface s_interf {}
72
protected static class s_interf_impl implements s_interf {}
73
s_interf_impl sii0 = new s_interf_impl();
74
s_interf s_interf_0, s_interf_1[]={s_interf_0}, s_interf_2[][]={s_interf_1};
75
76
isProtected001 a001_0=new isProtected001(), a001_1[]={a001_0},
77
a001_2[][]={a001_1};
78
79
// Class isPrivate001a is initialized in method main()
80
isProtected001a a0, a1[]={a0}, a2[][]={a1};
81
pack_priv_cls ppc0=new pack_priv_cls(), ppc1[]={ppc0}, ppc2[][]={ppc1};
82
pack_priv_interf_impl ppii0 = new pack_priv_interf_impl();
83
pack_priv_interf ppi0, ppi1[]={ppi0}, ppi2[][]={ppi1};
84
85
private static void print_log_on_verbose(String message) {
86
if ( verbose_mode ) {
87
System.err.println(message);
88
}
89
}
90
91
public static void main (String argv[]) {
92
93
for (int i=0; i<argv.length; i++) {
94
if ( argv[i].equals("-vbs") || argv[i].equals("-verbose") ) {
95
verbose_mode = true;
96
break;
97
}
98
}
99
100
print_log_on_verbose("**> isProtected001a: debugee started!");
101
isProtected001a isProtected001a_obj = new isProtected001a();
102
ArgumentHandler argHandler = new ArgumentHandler(argv);
103
IOPipe pipe = argHandler.createDebugeeIOPipe();
104
print_log_on_verbose("**> isProtected001a: waiting for \"quit\" signal...");
105
pipe.println("ready");
106
String instruction = pipe.readln();
107
if (instruction.equals("quit")) {
108
print_log_on_verbose("**> isProtected001a: \"quit\" signal recieved!");
109
print_log_on_verbose("**> isProtected001a: completed succesfully!");
110
System.exit(0/*STATUS_PASSED*/ + 95/*STATUS_TEMP*/);
111
}
112
System.err.println("!!**> isProtected001a: unexpected signal (no \"quit\") - " + instruction);
113
System.err.println("!!**> isProtected001a: FAILED!");
114
System.exit(2/*STATUS_FAILED*/ + 95/*STATUS_TEMP*/);
115
}
116
}
117
118
/** Sample package-private class. */
119
class pack_priv_cls {}
120
121
/** Sample package-private interface. */
122
interface pack_priv_interf {}
123
124
/** Class that implements package-private interface */
125
class pack_priv_interf_impl implements pack_priv_interf {}
126
127