Skip to content

Commit 6765a9d

Browse files
committed
8366908: Use a different class for testing JDK-8351654
Reviewed-by: liach, lmesnik
1 parent 166ef5e commit 6765a9d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

test/hotspot/jtreg/runtime/verifier/CFLH/TestVerify.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
*/
4040

4141
import java.lang.invoke.MethodHandles;
42-
import java.time.Duration;
4342
import java.lang.classfile.ClassFile;
4443
import java.lang.classfile.ClassTransform;
4544
import java.lang.classfile.MethodTransform;
@@ -61,7 +60,7 @@
6160

6261
public class TestVerify {
6362

64-
private static final String CLASS_TO_BREAK = "java.time.Duration";
63+
private static final String CLASS_TO_BREAK = "java.util.Date";
6564
private static final String INTERNAL_CLASS_TO_BREAK = CLASS_TO_BREAK.replace('.', '/');
6665
private static final boolean DEBUG = false;
6766

@@ -91,7 +90,7 @@ public byte[] transform(Module module, ClassLoader loader, String className, Cla
9190
}
9291
builder.with(element);
9392
});
94-
var classTransform = ClassTransform.transformingMethods(mm -> mm.methodName().stringValue().equals("getSeconds"), methodTransform);
93+
var classTransform = ClassTransform.transformingMethods(mm -> mm.methodName().equalsString("parse"), methodTransform);
9594

9695
byte[] bytes;
9796
try {
@@ -164,7 +163,7 @@ public static void main(String argv[]) throws Exception {
164163
} else {
165164
// Load the class instrumented with CFLH for the VerifyError.
166165
inst.addTransformer(new BadTransformer());
167-
System.out.println("1 hour is " + Duration.ofHours(1).getSeconds() + " seconds");
166+
Class<?> cls = Class.forName(CLASS_TO_BREAK);
168167
}
169168
throw new RuntimeException("Failed: Did not throw VerifyError");
170169
} catch (VerifyError e) {

0 commit comments

Comments
 (0)