Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jdwp/VirtualMachine/RedefineClasses/redefinecls001b.java
41161 views
1
/*
2
* Copyright (c) 2001, 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.jdwp.VirtualMachine.RedefineClasses;
25
26
import nsk.share.*;
27
28
/**
29
* This class is to be redefined.
30
*/
31
public class redefinecls001b {
32
33
// values for tested fields
34
public static final int INITIAL_FIELD_VALUE = 111;
35
public static final int FINAL_FIELD_VALUE = 222;
36
37
// values for method redefinition
38
public static final int METHOD_NOT_INVOKED = 0;
39
public static final int REDEFINED_METHOD_INVOKED = 10;
40
public static final int NOT_REDEFINED_METHOD_INVOKED = 20;
41
42
// static field
43
public static int staticField = INITIAL_FIELD_VALUE;
44
// object field
45
public int objectField = INITIAL_FIELD_VALUE;
46
47
public static Log log;
48
// fields for methods redefinition results
49
public static int constructorInvoked = METHOD_NOT_INVOKED;
50
public static int staticMethodInvoked = METHOD_NOT_INVOKED;
51
public static int objectMethodInvoked = METHOD_NOT_INVOKED;
52
53
// constructor
54
public redefinecls001b(int value) {
55
log.display("Constructor invoked: NOT REDEFINED");
56
constructorInvoked = NOT_REDEFINED_METHOD_INVOKED;
57
objectField = value;
58
}
59
60
// static method to be redefined
61
public static void testedStaticMethod() {
62
log.display("Static method invoked: NOT REDEFINED");
63
staticMethodInvoked = NOT_REDEFINED_METHOD_INVOKED;
64
65
log.display("Static fields values:");
66
log.display(" staticField: " + staticField
67
+ " (expected: " + FINAL_FIELD_VALUE + ")");
68
}
69
70
// object method to be redefined
71
public void testedObjectMethod() {
72
log.display("Object method invoked: NOT REDEFINED");
73
objectMethodInvoked = NOT_REDEFINED_METHOD_INVOKED;
74
75
log.display("Object fields values:");
76
log.display(" objectField: " + objectField
77
+ " (expected: " + FINAL_FIELD_VALUE + ")"); // BREAKPOINT_LINE_BEFORE
78
}
79
}
80
81