File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
test/hotspot/jtreg/runtime/ClassUnload Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2018, 2023 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2018, 2024 , 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
3939import jdk .test .lib .classloader .ClassUnloadCommon ;
4040
4141import java .lang .ref .Reference ;
42+ import java .util .List ;
43+ import java .util .Set ;
4244public class ConstantPoolDependsTest {
4345 public static WhiteBox wb = WhiteBox .getWhiteBox ();
4446 public static final String MY_TEST = "ConstantPoolDependsTest$c1c" ;
@@ -78,10 +80,7 @@ static void test() throws Throwable {
7880
7981 public static void main (String args []) throws Throwable {
8082 test ();
81- ClassUnloadCommon .triggerUnloading (); // should unload
82- System .gc ();
83- System .out .println ("Should unload p2.c2 just now" );
84- ClassUnloadCommon .failIf (wb .isClassAlive (MY_TEST ), "should be unloaded" );
85- ClassUnloadCommon .failIf (wb .isClassAlive ("p2.c2" ), "should be unloaded" );
83+ Set <String > aliveClasses = ClassUnloadCommon .triggerUnloading (List .of (MY_TEST , "p2.c2" ));
84+ ClassUnloadCommon .failIf (!aliveClasses .isEmpty (), "should be unloaded: " + aliveClasses );
8685 }
8786}
You can’t perform that action at this time.
0 commit comments