Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jdi/LocalVariable/genericSignature/gensignature001a.java
41161 views
1
/*
2
* Copyright (c) 2004, 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.LocalVariable.genericSignature;
25
26
import nsk.share.*;
27
import nsk.share.jpda.*;
28
import nsk.share.jdi.*;
29
30
import java.util.*;
31
import java.io.*;
32
33
/**
34
* This class is used as debugee part of the test.
35
*/
36
37
public class gensignature001a {
38
39
private static ArgumentHandler argsHandler;
40
private static Log log;
41
private static IOPipe pipe;
42
43
//------------------------------------------------------- immutable common methods
44
45
static void display(String msg) {
46
log.display("debuggee > " + msg);
47
}
48
49
static void complain(String msg) {
50
log.complain("debuggee FAILURE > " + msg);
51
}
52
53
public static void receiveSignal(String signal) {
54
String line = pipe.readln();
55
56
if ( !line.equals(signal) )
57
throw new Failure("UNEXPECTED debugger's signal " + line);
58
59
display("debugger's <" + signal + "> signal received.");
60
}
61
62
//------------------------------------------------------ mutable common fields
63
64
public static void main(String args[]) {
65
gensignature001a _gensignature001a = new gensignature001a();
66
System.exit(Consts.JCK_STATUS_BASE + _gensignature001a.runThis(args, System.err));
67
}
68
69
public int runThis(String args[], PrintStream out) {
70
71
argsHandler = new ArgumentHandler(args);
72
log = new Log(out, argsHandler);
73
pipe = argsHandler.createDebugeeIOPipe(log);
74
75
display("Debugee started!");
76
77
// ensure tested class loaded
78
display("Creating object of tested class");
79
TestedClass<String, Long> foo = new TestedClass<String, Long>();
80
81
// send debugger signal READY
82
display("Sending signal to debugger: " + gensignature001.READY);
83
pipe.println(gensignature001.READY);
84
85
// wait for signal QUIT from debugeer
86
display("Wait for '" + gensignature001.QUIT + "' signal from debugger...");
87
receiveSignal(gensignature001.QUIT);
88
89
display("Debugee PASSED");
90
return Consts.TEST_PASSED;
91
}
92
93
// tested class
94
public static class TestedClass<T, N extends Number> {
95
int foo = 0;
96
97
// tested method
98
public void testedMethod(
99
// not generic argumments
100
boolean arg11PrimBoolean,
101
int arg12PrimInt,
102
Object arg13Object,
103
String arg14String,
104
short[] arg15PrimArrShort,
105
Object[] arg16ObjArrObject,
106
107
// generic arguments
108
T arg21GenObject,
109
N arg22GenNumber,
110
T[] arg23GenObjectArr,
111
N[] arg24GenNumberArr,
112
List<T> arg25GenObjectList,
113
List<N> arg26GenNumberList,
114
List<? extends T> arg27GenObjectDerivedList,
115
List<? extends N> arg28GenNumberDerivedList
116
) {
117
118
// not generic variables
119
boolean var11PrimBoolean = arg11PrimBoolean;
120
int var12PrimInt = arg12PrimInt;
121
Object var13Object = arg13Object;
122
String var14String = arg14String;
123
short[] var15PrimArrShort = arg15PrimArrShort;
124
Object[] var16ObjArrObject = arg16ObjArrObject;
125
126
// generic variables
127
T var21GenObject = arg21GenObject;
128
N var22GenNumber = arg22GenNumber;
129
T[] var23GenObjectArr = arg23GenObjectArr;
130
N[] var24GenNumberArr = arg24GenNumberArr;
131
List<T> var25GenObjectList = arg25GenObjectList;
132
List<N> var26GenNumberList = arg26GenNumberList;
133
List<? extends T> var27GenObjectDerivedList = arg27GenObjectDerivedList;
134
List<? extends N> var28GenNumberDerivedList = arg28GenNumberDerivedList;
135
}
136
}
137
} // end of gensignature001a class
138
139