8288651: CDS test HelloUnload.java should not use literal string as ClassLoader name

Reviewed-by: coleenp, iklam
This commit is contained in:
Calvin Cheung 2022-06-27 21:16:02 +00:00
parent 40bf3b1167
commit e322e77e95

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -73,7 +73,7 @@ public class HelloUnload {
}
URLClassLoader urlClassLoader =
new URLClassLoader("HelloClassLoader", urls, null);
new URLClassLoader("HelloClassLoader" + System.currentTimeMillis(), urls, null);
Class c = Class.forName(className, true, urlClassLoader);
if (keepAlive) {
keptC = c;