Skip to content

Commit 23fc21a

Browse files
committed
8374052: Use java/util/Calendar in ReplaceCriticalClasses.java test
Reviewed-by: iklam
1 parent 821e9ff commit 23fc21a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

test/hotspot/jtreg/runtime/cds/serviceability/ReplaceCriticalClasses.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ public String[] getTests() {
9898
// Replace classes that are loaded after JVMTI_PHASE_PRIMORDIAL. It's OK to replace
9999
// such
100100
// classes even when CDS is enabled. Nothing bad should happen.
101-
"-notshared java/util/Locale",
102-
"-notshared sun/util/locale/BaseLocale",
101+
"-notshared java/util/Calendar",
103102
};
104103
return tests;
105104
}
@@ -149,16 +148,16 @@ static void launchChild(String args[]) throws Throwable {
149148
Class.forName(klassName.replace("/", ".")); // make sure it's a valid class
150149
final String subgraphInit = "initialize_from_archived_subgraph " + subgraphKlass;
151150

152-
// We will pass an option like "-agentlib:SimpleClassFileLoadHook=java/util/Locale,XXX,XXX".
153-
// The SimpleClassFileLoadHook agent would attempt to hook the java/util/Locale class
151+
// We will pass an option like "-agentlib:SimpleClassFileLoadHook=java/util/Calendar,XXX,XXX".
152+
// The SimpleClassFileLoadHook agent would attempt to hook the java/util/Calendar class
154153
// but leave the class file bytes unchanged (it replaces all bytes "XXX" with "XXX", i.e.,
155154
// a no-op). JVMTI doesn't check the class file bytes returned by the agent, so as long
156155
// as the agent returns a buffer, it will not load the class from CDS, and will instead
157156
// load the class by parsing the buffer.
158157
//
159158
// Note that for safety we don't change the contents of the class file bytes. If in the
160159
// future JVMTI starts checking the contents of the class file bytes, this test would need
161-
// to be updated. (You'd see the test case with java/util/Locale staring to fail).
160+
// to be updated. (You'd see the test case with java/util/Calendar staring to fail).
162161
String agent = "-agentlib:SimpleClassFileLoadHook=" + early + klassName + ",XXX,XXX";
163162

164163
CDSOptions opts = (new CDSOptions())

0 commit comments

Comments
 (0)