Enforce early initialization of CGLIB method proxies (for AOT processing)
For non-required method proxies, prefer regular reflective invocation instead. See gh-29107
This commit is contained in:
parent
332961f833
commit
d873f60fef
|
@ -541,7 +541,7 @@ class ConfigurationClassEnhancer {
|
|||
if (method.getName().equals("getObject") && args.length == 0) {
|
||||
return beanFactory.getBean(beanName);
|
||||
}
|
||||
return proxy.invoke(factoryBean, args);
|
||||
return method.invoke(factoryBean, args);
|
||||
});
|
||||
|
||||
return fbProxy;
|
||||
|
|
|
@ -55,6 +55,13 @@ public class MethodProxy {
|
|||
proxy.sig1 = new Signature(name1, desc);
|
||||
proxy.sig2 = new Signature(name2, desc);
|
||||
proxy.createInfo = new CreateInfo(c1, c2);
|
||||
|
||||
// SPRING PATCH BEGIN: early initialization for overridden methods on subclasses
|
||||
if (!c1.isInterface()) {
|
||||
proxy.init();
|
||||
}
|
||||
// SPRING PATCH END
|
||||
|
||||
return proxy;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue