Enforce static initialization of CGLIB method proxies on attemptLoad

This propagates current Enhancer settings (naming strategy etc) to the method proxies.

See gh-29107
This commit is contained in:
Juergen Hoeller 2022-10-04 12:24:09 +02:00
parent 01025c8551
commit 4a2b058b0a
1 changed files with 3 additions and 1 deletions

View File

@ -348,7 +348,9 @@ abstract public class AbstractClassGenerator<T> implements ClassGenerator {
}
if (attemptLoad) {
try {
gen = classLoader.loadClass(getClassName());
// SPRING PATCH BEGIN
gen = Class.forName(getClassName(), true, classLoader);
// SPRING PATCH END
return gen;
}
catch (ClassNotFoundException e) {