8291640: java/beans/XMLDecoder/8028054/Task.java should use the 3-arg Class.forName

Co-authored-by: Alan Bateman <alanb@openjdk.org>
Reviewed-by: alanb, prr
This commit is contained in:
Ao Qi 2022-08-11 19:30:20 +00:00 committed by Phil Race
parent 3d20a8b20a
commit dedc05cb40
3 changed files with 5 additions and 4 deletions
test/jdk/java/beans/XMLDecoder/8028054

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 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
@ -130,8 +130,9 @@ abstract class Task<T> implements Runnable {
.map(s -> s.substring(s.indexOf("java")))
.collect(Collectors.toList());
ClassLoader scl = ClassLoader.getSystemClassLoader();
for (String name : fileNames) {
classes.add(Class.forName(name));
classes.add(Class.forName(name, false, scl));
if (count == classes.size()) {
break;
}

@ -35,7 +35,7 @@ import java.util.List;
* @author Sergey Malenkov
* @modules java.desktop/com.sun.beans.finder
* @compile -XDignore.symbol.file TestConstructorFinder.java
* @run main/othervm --enable-preview TestConstructorFinder
* @run main TestConstructorFinder
*/
public class TestConstructorFinder {

@ -35,7 +35,7 @@ import java.util.List;
* @author Sergey Malenkov
* @modules java.desktop/com.sun.beans.finder
* @compile -XDignore.symbol.file TestMethodFinder.java
* @run main/othervm --enable-preview TestMethodFinder
* @run main TestMethodFinder
*/
public class TestMethodFinder {