Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jdi/Field/isEnumConstant/isenumconstant001a.java
41160 views
1
/*
2
* Copyright (c) 2003, 2018, 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.Field.isEnumConstant;
25
26
import nsk.share.*;
27
import nsk.share.jpda.*;
28
import nsk.share.jdi.*;
29
30
/**
31
* The debugged application of the test.
32
*/
33
public class isenumconstant001a {
34
35
//------------------------------------------------------- immutable common fields
36
37
private static int exitStatus;
38
private static ArgumentHandler argHandler;
39
private static Log log;
40
private static IOPipe pipe;
41
42
//------------------------------------------------------- immutable common methods
43
44
static void display(String msg) {
45
log.display("debuggee > " + msg);
46
}
47
48
static void complain(String msg) {
49
log.complain("debuggee FAILURE > " + msg);
50
}
51
52
public static void receiveSignal(String signal) {
53
String line = pipe.readln();
54
55
if ( !line.equals(signal) )
56
throw new Failure("UNEXPECTED debugger's signal " + line);
57
58
display("debugger's <" + signal + "> signal received.");
59
}
60
61
//------------------------------------------------------ mutable common fields
62
63
//------------------------------------------------------ test specific fields
64
65
static isenumconstant001Enum1 f1 = isenumconstant001Enum1.e2;
66
static isenumconstant001Enum2 f2 = isenumconstant001Enum2.e1;
67
static isenumconstant001Enum3 f3 = isenumconstant001Enum3.e1;
68
static isenumconstant001Enum1.Enum1_ f4 = isenumconstant001Enum1.Enum1_.e1;
69
70
//------------------------------------------------------ mutable common method
71
72
public static void main (String argv[]) {
73
exitStatus = Consts.TEST_FAILED;
74
argHandler = new ArgumentHandler(argv);
75
log = new Log(System.err, argHandler);
76
pipe = argHandler.createDebugeeIOPipe(log);
77
78
pipe.println(isenumconstant001.SIGNAL_READY);
79
80
81
//pipe.println(isenumconstant001.SIGNAL_GO);
82
receiveSignal(isenumconstant001.SIGNAL_QUIT);
83
84
display("completed succesfully.");
85
System.exit(Consts.TEST_PASSED + Consts.JCK_STATUS_BASE);
86
}
87
88
//--------------------------------------------------------- test specific inner classes
89
90
}
91
92
//--------------------------------------------------------- test specific classes
93
94
enum isenumconstant001Enum1 {
95
e1, e2;
96
97
enum Enum1_ {
98
e1, e2;
99
}
100
}
101
102
enum isenumconstant001Enum2 {
103
e1 {
104
int val() {return 1;}
105
},
106
107
e2 {
108
int val() {return 2;}
109
};
110
abstract int val();
111
}
112
113
enum isenumconstant001Enum3 {
114
e1(1), e2(2);
115
116
int ii;
117
118
isenumconstant001Enum3 (int i) {
119
ii = i;
120
}
121
}
122
123