-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8366908: Use a different class for testing JDK-8351654 #27116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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) { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.