Use Class.forName rather than ClassLoader.loadClass
This commit changes uses of ClassLoader.loadClass to Class.forName for consistency with what was initiated in #19342 and better compatibility with GraalVM. Closes gh-19824
This commit is contained in:
@@ -32,7 +32,7 @@ public class SampleApplication {
|
||||
|
||||
try {
|
||||
ClassLoader classLoader = SampleApplication.class.getClassLoader();
|
||||
classLoader.loadClass(className);
|
||||
Class.forName(className, false, classLoader);
|
||||
return true;
|
||||
}
|
||||
catch (ClassNotFoundException e) {
|
||||
|
||||
Reference in New Issue
Block a user