Skip to content

Commit c59e44a

Browse files
committed
8357914: TestEmptyBootstrapMethodsAttr.java fails when run with TEST_THREAD_FACTORY=Virtual
Reviewed-by: lmesnik, dholmes, sspitsyn, syan
1 parent 23f1d4f commit c59e44a

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

test/hotspot/jtreg/ProblemList-Virtual.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ vmTestbase/nsk/jdi/ThreadReference/isSuspended/issuspended002/TestDescription.ja
9090

9191
gc/arguments/TestNewSizeThreadIncrease.java 0000000 generic-all
9292
gc/g1/TestSkipRebuildRemsetPhase.java 0000000 generic-all
93-
runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java 8346442 generic-all
9493
runtime/ErrorHandling/MachCodeFramesInErrorFile.java 0000000 generic-all
9594
runtime/Thread/AsyncExceptionOnMonitorEnter.java 0000000 generic-all
9695
runtime/Thread/StopAtExit.java 0000000 generic-all

test/hotspot/jtreg/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -54,8 +54,13 @@ public static void main(String args[]) throws Throwable {
5454
"-Duser.language=en", "-Duser.country=US", className);
5555
OutputAnalyzer output = new OutputAnalyzer(pb.start());
5656
output.shouldNotContain("java.lang.ClassFormatError");
57-
output.shouldContain("Main method not found in class " + className);
5857
output.shouldHaveExitValue(1);
58+
boolean vthreadMode = pb.command().toString().contains("test.thread.factory=Virtual");
59+
if (vthreadMode) {
60+
output.shouldContain("java.lang.NoSuchMethodException: " + className + ".main");
61+
} else {
62+
output.shouldContain("Main method not found in class " + className);
63+
}
5964

6065
// Test case #2:
6166
// Try loading class with empty bootstrap_methods table where an
@@ -69,7 +74,12 @@ public static void main(String args[]) throws Throwable {
6974
"-Duser.language=en", "-Duser.country=US", className);
7075
output = new OutputAnalyzer(pb.start());
7176
output.shouldNotContain("java.lang.ClassFormatError");
72-
output.shouldContain("Main method not found in class " + className);
7377
output.shouldHaveExitValue(1);
78+
vthreadMode = pb.command().toString().contains("test.thread.factory=Virtual");
79+
if (vthreadMode) {
80+
output.shouldContain("java.lang.NoSuchMethodException: " + className + ".main");
81+
} else {
82+
output.shouldContain("Main method not found in class " + className);
83+
}
7484
}
7585
}

0 commit comments

Comments
 (0)