Skip to content

Commit be9fc0b

Browse files
committed
8334320: Replace vmTestbase/metaspace/share/TriggerUnloadingWithWhiteBox.java with ClassUnloadCommon from testlibrary
Backport-of: 9b49597244f898400222cfc252f50a2401ca3e2f
1 parent 144e626 commit be9fc0b

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

test/hotspot/jtreg/vmTestbase/metaspace/share/TriggerUnloadingWithWhiteBox.java renamed to test/hotspot/jtreg/vmTestbase/metaspace/share/TriggerUnloadingWithFullGC.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 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
@@ -20,19 +20,17 @@
2020
* or visit www.oracle.com if you need additional information or have any
2121
* questions.
2222
*/
23-
package metaspace.share;
2423

24+
package metaspace.share;
2525

26-
import jdk.test.whitebox.WhiteBox;
26+
import jdk.test.lib.classloader.ClassUnloadCommon;
2727
import nsk.share.test.ExecutionController;
2828

29-
public class TriggerUnloadingWithWhiteBox implements TriggerUnloadingHelper {
30-
31-
private final static WhiteBox wb = WhiteBox.getWhiteBox();
29+
public class TriggerUnloadingWithFullGC implements TriggerUnloadingHelper {
3230

3331
@Override
3432
public void triggerUnloading(ExecutionController stresser) {
35-
wb.fullGC();
33+
ClassUnloadCommon.triggerUnloading();
3634
}
3735

3836
}

test/hotspot/jtreg/vmTestbase/metaspace/staticReferences/StaticReferences.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 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,7 +54,7 @@
5454
import java.util.Random;
5555

5656
import metaspace.share.TriggerUnloadingHelper;
57-
import metaspace.share.TriggerUnloadingWithWhiteBox;
57+
import metaspace.share.TriggerUnloadingWithFullGC;
5858
import nsk.share.gc.GCTestBase;
5959
import nsk.share.test.ExecutionController;
6060
import nsk.share.test.Stresser;
@@ -86,7 +86,7 @@ public class StaticReferences extends GCTestBase {
8686

8787
private Random random;
8888

89-
private TriggerUnloadingHelper triggerUnloadingHelper = new TriggerUnloadingWithWhiteBox();
89+
private TriggerUnloadingHelper triggerUnloadingHelper = new TriggerUnloadingWithFullGC();
9090

9191
private String[] typesArray = new String[] {"Object object", "boolean boolean", "byte byte", "char char", "double double", "float float", "int int", "long long", "short short"};
9292

test/hotspot/jtreg/vmTestbase/metaspace/stressHierarchy/common/StressHierarchyBaseClass.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 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
@@ -27,7 +27,7 @@
2727
import metaspace.share.HeapOOMEException;
2828
import metaspace.share.TriggerUnloadingByFillingMetaspace;
2929
import metaspace.share.TriggerUnloadingHelper;
30-
import metaspace.share.TriggerUnloadingWithWhiteBox;
30+
import metaspace.share.TriggerUnloadingWithFullGC;
3131
import metaspace.stressHierarchy.common.classloader.tree.Node;
3232
import metaspace.stressHierarchy.common.classloader.tree.Tree;
3333
import metaspace.stressHierarchy.common.exceptions.TimeIsOverException;
@@ -48,7 +48,7 @@ abstract public class StressHierarchyBaseClass extends TestBase {
4848

4949
protected static String[] args;
5050

51-
protected TriggerUnloadingHelper triggerUnloadingHelper = new TriggerUnloadingWithWhiteBox(); //default helper
51+
protected TriggerUnloadingHelper triggerUnloadingHelper = new TriggerUnloadingWithFullGC(); //default helper
5252

5353
protected PerformChecksHelper performChecksHelper = null;
5454

0 commit comments

Comments
 (0)