Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetClassMethods/getclmthd007.java
40948 views
1
/*
2
* Copyright (c) 2003, 2020, 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.jvmti.GetClassMethods;
25
26
import java.io.PrintStream;
27
28
public class getclmthd007 {
29
30
final static int JCK_STATUS_BASE = 95;
31
32
static {
33
try {
34
System.loadLibrary("getclmthd007");
35
} catch (UnsatisfiedLinkError ule) {
36
System.err.println("Could not load getclmthd007 library");
37
System.err.println("java.library.path:"
38
+ System.getProperty("java.library.path"));
39
throw ule;
40
}
41
}
42
43
native static void check(int i, Class cls);
44
native static int getRes();
45
46
public static void main(String args[]) {
47
args = nsk.share.jvmti.JVMTITest.commonInit(args);
48
49
// produce JCK-like exit status.
50
System.exit(run(args, System.out) + JCK_STATUS_BASE);
51
}
52
53
public static int run(String args[], PrintStream out) {
54
try {
55
check(0, Class.forName(InnerClass1.class.getName()));
56
check(1, Class.forName(InnerInterface.class.getName()));
57
check(2, Class.forName(InnerClass2.class.getName()));
58
check(3, Class.forName(OuterClass1.class.getName()));
59
check(4, Class.forName(OuterClass2.class.getName()));
60
check(5, Class.forName(OuterClass3.class.getName()));
61
check(6, Class.forName(OuterInterface1.class.getName()));
62
check(7, Class.forName(OuterInterface2.class.getName()));
63
check(8, Class.forName(OuterClass4.class.getName()));
64
check(9, Class.forName(OuterClass5.class.getName()));
65
} catch (ClassNotFoundException e) {
66
throw new RuntimeException(e);
67
}
68
return getRes();
69
}
70
71
static void meth_0(int i) {
72
int ifld;
73
ifld = i;
74
}
75
76
class InnerClass1 {
77
String fld;
78
void meth_1(String s) {
79
fld = s;
80
}
81
}
82
83
static interface InnerInterface {
84
default void meth_def1() {}
85
void meth_n1();
86
}
87
88
static class InnerClass2 implements InnerInterface {
89
static int count = 0;
90
public void meth_n1() {
91
count++;
92
}
93
int meth_n2() {
94
return 1;
95
}
96
}
97
}
98
99
class OuterClass1 extends getclmthd007 {
100
}
101
102
class OuterClass2 extends OuterClass1 {
103
public void meth_o2() {
104
}
105
}
106
107
class OuterClass3 {
108
int meth_o3() {
109
return 3;
110
}
111
}
112
113
interface DefaultInterface {
114
default void default_method() { }
115
}
116
117
interface OuterInterface1 extends DefaultInterface {
118
int meth_i1();
119
}
120
121
interface OuterInterface2 extends OuterInterface1 {
122
int meth_i2();
123
}
124
125
abstract class OuterClass4 extends OuterClass3 implements OuterInterface2 {
126
public int meth_i2() {
127
return 2;
128
}
129
}
130
131
class OuterClass5 extends OuterClass4 {
132
public int meth_i1() {
133
return 1;
134
}
135
}
136
137