mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Enforce publicly accessible method for externalClassLoader(ClassLoader)
Closes gh-36012
This commit is contained in:
+2
@@ -53,6 +53,7 @@ import org.springframework.context.MessageSource;
|
||||
import org.springframework.core.ParameterNameDiscoverer;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
|
||||
@@ -264,6 +265,7 @@ public class LocalValidatorFactoryBean extends SpringValidatorAdapter
|
||||
if (this.applicationContext != null) {
|
||||
try {
|
||||
Method eclMethod = configuration.getClass().getMethod("externalClassLoader", ClassLoader.class);
|
||||
eclMethod = ClassUtils.getPubliclyAccessibleMethodIfPossible(eclMethod, configuration.getClass());
|
||||
ReflectionUtils.invokeMethod(eclMethod, configuration, this.applicationContext.getClassLoader());
|
||||
}
|
||||
catch (NoSuchMethodException ignored) {
|
||||
|
||||
Reference in New Issue
Block a user