From b3480350aa9f8cebb1361443aa7c4e32a648e92a Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Thu, 4 Sep 2025 16:14:12 +0000 Subject: [PATCH 1/3] 8366908: Use a different class for testing JDK-8351654 --- test/hotspot/jtreg/runtime/verifier/CFLH/TestVerify.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/hotspot/jtreg/runtime/verifier/CFLH/TestVerify.java b/test/hotspot/jtreg/runtime/verifier/CFLH/TestVerify.java index 214751863ead6..ece28344751b2 100644 --- a/test/hotspot/jtreg/runtime/verifier/CFLH/TestVerify.java +++ b/test/hotspot/jtreg/runtime/verifier/CFLH/TestVerify.java @@ -39,7 +39,6 @@ */ import java.lang.invoke.MethodHandles; -import java.time.Duration; import java.lang.classfile.ClassFile; import java.lang.classfile.ClassTransform; import java.lang.classfile.MethodTransform; @@ -61,7 +60,7 @@ public class TestVerify { - private static final String CLASS_TO_BREAK = "java.time.Duration"; + private static final String CLASS_TO_BREAK = "java.util.Date"; private static final String INTERNAL_CLASS_TO_BREAK = CLASS_TO_BREAK.replace('.', '/'); private static final boolean DEBUG = false; @@ -91,7 +90,7 @@ public byte[] transform(Module module, ClassLoader loader, String className, Cla } builder.with(element); }); - var classTransform = ClassTransform.transformingMethods(mm -> mm.methodName().stringValue().equals("getSeconds"), methodTransform); + var classTransform = ClassTransform.transformingMethods(mm -> mm.methodName().stringValue().equals("parse"), methodTransform); byte[] bytes; try { @@ -164,7 +163,8 @@ public static void main(String argv[]) throws Exception { } else { // Load the class instrumented with CFLH for the VerifyError. inst.addTransformer(new BadTransformer()); - System.out.println("1 hour is " + Duration.ofHours(1).getSeconds() + " seconds"); + Class cls = Class.forName(CLASS_TO_BREAK); + System.out.println("class loaded" + cls); } throw new RuntimeException("Failed: Did not throw VerifyError"); } catch (VerifyError e) { From 0616cf6560abe4dd469358d0ae3791f16c262651 Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Fri, 5 Sep 2025 15:38:01 +0000 Subject: [PATCH 2/3] remove unreachable line. --- test/hotspot/jtreg/runtime/verifier/CFLH/TestVerify.java | 1 - 1 file changed, 1 deletion(-) diff --git a/test/hotspot/jtreg/runtime/verifier/CFLH/TestVerify.java b/test/hotspot/jtreg/runtime/verifier/CFLH/TestVerify.java index ece28344751b2..90b95c219fe2e 100644 --- a/test/hotspot/jtreg/runtime/verifier/CFLH/TestVerify.java +++ b/test/hotspot/jtreg/runtime/verifier/CFLH/TestVerify.java @@ -164,7 +164,6 @@ public static void main(String argv[]) throws Exception { // Load the class instrumented with CFLH for the VerifyError. inst.addTransformer(new BadTransformer()); Class cls = Class.forName(CLASS_TO_BREAK); - System.out.println("class loaded" + cls); } throw new RuntimeException("Failed: Did not throw VerifyError"); } catch (VerifyError e) { From e95eff7d6bca0c61b8d92284b89b3db99c4595fd Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Mon, 8 Sep 2025 07:27:27 -0400 Subject: [PATCH 3/3] Update test/hotspot/jtreg/runtime/verifier/CFLH/TestVerify.java Co-authored-by: ExE Boss <3889017+ExE-Boss@users.noreply.github.com> --- test/hotspot/jtreg/runtime/verifier/CFLH/TestVerify.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/hotspot/jtreg/runtime/verifier/CFLH/TestVerify.java b/test/hotspot/jtreg/runtime/verifier/CFLH/TestVerify.java index 90b95c219fe2e..33cb881e53728 100644 --- a/test/hotspot/jtreg/runtime/verifier/CFLH/TestVerify.java +++ b/test/hotspot/jtreg/runtime/verifier/CFLH/TestVerify.java @@ -90,7 +90,7 @@ public byte[] transform(Module module, ClassLoader loader, String className, Cla } builder.with(element); }); - var classTransform = ClassTransform.transformingMethods(mm -> mm.methodName().stringValue().equals("parse"), methodTransform); + var classTransform = ClassTransform.transformingMethods(mm -> mm.methodName().equalsString("parse"), methodTransform); byte[] bytes; try {