From 23fc21a3e2db11e24568d4c47e52efc6947e956b Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Fri, 19 Dec 2025 17:45:14 +0000 Subject: [PATCH] 8374052: Use java/util/Calendar in ReplaceCriticalClasses.java test Reviewed-by: iklam --- .../cds/serviceability/ReplaceCriticalClasses.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/test/hotspot/jtreg/runtime/cds/serviceability/ReplaceCriticalClasses.java b/test/hotspot/jtreg/runtime/cds/serviceability/ReplaceCriticalClasses.java index 5e561ed8b31..408ab0582b1 100644 --- a/test/hotspot/jtreg/runtime/cds/serviceability/ReplaceCriticalClasses.java +++ b/test/hotspot/jtreg/runtime/cds/serviceability/ReplaceCriticalClasses.java @@ -98,8 +98,7 @@ public class ReplaceCriticalClasses { // Replace classes that are loaded after JVMTI_PHASE_PRIMORDIAL. It's OK to replace // such // classes even when CDS is enabled. Nothing bad should happen. - "-notshared java/util/Locale", - "-notshared sun/util/locale/BaseLocale", + "-notshared java/util/Calendar", }; return tests; } @@ -149,8 +148,8 @@ public class ReplaceCriticalClasses { Class.forName(klassName.replace("/", ".")); // make sure it's a valid class final String subgraphInit = "initialize_from_archived_subgraph " + subgraphKlass; - // We will pass an option like "-agentlib:SimpleClassFileLoadHook=java/util/Locale,XXX,XXX". - // The SimpleClassFileLoadHook agent would attempt to hook the java/util/Locale class + // We will pass an option like "-agentlib:SimpleClassFileLoadHook=java/util/Calendar,XXX,XXX". + // The SimpleClassFileLoadHook agent would attempt to hook the java/util/Calendar class // but leave the class file bytes unchanged (it replaces all bytes "XXX" with "XXX", i.e., // a no-op). JVMTI doesn't check the class file bytes returned by the agent, so as long // as the agent returns a buffer, it will not load the class from CDS, and will instead @@ -158,7 +157,7 @@ public class ReplaceCriticalClasses { // // Note that for safety we don't change the contents of the class file bytes. If in the // future JVMTI starts checking the contents of the class file bytes, this test would need - // to be updated. (You'd see the test case with java/util/Locale staring to fail). + // to be updated. (You'd see the test case with java/util/Calendar staring to fail). String agent = "-agentlib:SimpleClassFileLoadHook=" + early + klassName + ",XXX,XXX"; CDSOptions opts = (new CDSOptions())