Skip to content

Commit d99ace8

Browse files
committed
Enforce publicly accessible method for externalClassLoader(ClassLoader)
Closes gh-36012
1 parent ed451c1 commit d99ace8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

spring-context/src/main/java/org/springframework/validation/beanvalidation/LocalValidatorFactoryBean.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
import org.springframework.core.ParameterNameDiscoverer;
5454
import org.springframework.core.io.Resource;
5555
import org.springframework.util.Assert;
56+
import org.springframework.util.ClassUtils;
5657
import org.springframework.util.CollectionUtils;
5758
import org.springframework.util.ReflectionUtils;
5859

@@ -264,6 +265,7 @@ public void afterPropertiesSet() {
264265
if (this.applicationContext != null) {
265266
try {
266267
Method eclMethod = configuration.getClass().getMethod("externalClassLoader", ClassLoader.class);
268+
eclMethod = ClassUtils.getPubliclyAccessibleMethodIfPossible(eclMethod, configuration.getClass());
267269
ReflectionUtils.invokeMethod(eclMethod, configuration, this.applicationContext.getClassLoader());
268270
}
269271
catch (NoSuchMethodException ignored) {

0 commit comments

Comments
 (0)