Post-processors ignore AopInfrastructureBean (includes ScopedObject)

Issue: SPR-17166
This commit is contained in:
Juergen Hoeller
2018-08-11 23:10:57 +02:00
parent 8bf8092740
commit 71d4dbea13
2 changed files with 5 additions and 7 deletions

View File

@@ -20,7 +20,6 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.springframework.aop.Advisor;
import org.springframework.aop.scope.ScopedObject;
import org.springframework.aop.support.AopUtils;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.lang.Nullable;
@@ -64,7 +63,7 @@ public abstract class AbstractAdvisingBeanPostProcessor extends ProxyProcessorSu
@Override
public Object postProcessAfterInitialization(Object bean, String beanName) {
if (this.advisor == null || bean instanceof ScopedObject || bean instanceof AopInfrastructureBean) {
if (this.advisor == null || bean instanceof AopInfrastructureBean) {
// Ignore AOP infrastructure such as scoped proxies.
return bean;
}
@@ -93,7 +92,7 @@ public abstract class AbstractAdvisingBeanPostProcessor extends ProxyProcessorSu
return proxyFactory.getProxy(getProxyClassLoader());
}
// No async proxy needed.
// No proxy needed.
return bean;
}