Skip to content

Commit

Permalink
[GR-52267] Update ReflectionUtil to enable lookupClasses with custom …
Browse files Browse the repository at this point in the history
…class loaders

PullRequest: graal/17606
  • Loading branch information
cugurm committed Nov 1, 2024
2 parents a221fff + 0fcf4bb commit 4e459bf
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,12 @@ public static Class<?> lookupClass(String className) {
}

public static Class<?> lookupClass(boolean optional, String className) {
return lookupClass(optional, className, ReflectionUtil.class.getClassLoader());
}

public static Class<?> lookupClass(boolean optional, String className, ClassLoader loader) {
try {
return Class.forName(className, false, ReflectionUtil.class.getClassLoader());
return Class.forName(className, false, loader);
} catch (ClassNotFoundException ex) {
if (optional) {
return null;
Expand Down

0 comments on commit 4e459bf

Please sign in to comment.