mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 03:58:21 +00:00
8355632: WhiteBox.waitForReferenceProcessing() fails assert for return type
Reviewed-by: kbarrett
This commit is contained in:
parent
c2485d5f7d
commit
bf52eb0358
30
test/lib-test/jdk/test/whitebox/WaitForRefProcTest.java
Normal file
30
test/lib-test/jdk/test/whitebox/WaitForRefProcTest.java
Normal file
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* @test
|
||||
* @summary Test WhiteBox.waitForReferenceProcessing
|
||||
* @bug 8305186 8355632
|
||||
* @library /test/lib
|
||||
* @build jdk.test.whitebox.WhiteBox
|
||||
* @modules java.base/java.lang.ref:open
|
||||
* @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
|
||||
* @run main/othervm -ea -esa
|
||||
* -Xbootclasspath/a:.
|
||||
* -XX:+UnlockDiagnosticVMOptions
|
||||
* -XX:+WhiteBoxAPI
|
||||
* WaitForRefProcTest
|
||||
*/
|
||||
|
||||
import jdk.test.whitebox.WhiteBox;
|
||||
|
||||
public class WaitForRefProcTest {
|
||||
|
||||
public static void main(String[] args) {
|
||||
WhiteBox.getWhiteBox().fullGC();
|
||||
try {
|
||||
boolean ret = WhiteBox.getWhiteBox().waitForReferenceProcessing();
|
||||
System.out.println("wFRP returned " + ret);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException("test caught InterruptedException");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -569,7 +569,7 @@ public class WhiteBox {
|
||||
try {
|
||||
wfrp = Reference.class.getDeclaredMethod("waitForReferenceProcessing");
|
||||
wfrp.setAccessible(true);
|
||||
assert wfrp.getReturnType() == Boolean.class;
|
||||
assert wfrp.getReturnType().equals(boolean.class);
|
||||
Class<?>[] ev = wfrp.getExceptionTypes();
|
||||
assert ev.length == 1;
|
||||
assert ev[0] == InterruptedException.class;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user