Avoid repeated exposure of SpringProxy/Advised for fallback interfaces as well

Issue: SPR-12870
This commit is contained in:
Juergen Hoeller
2015-04-01 18:54:47 +02:00
parent 514eb4281c
commit e1395a6c68
2 changed files with 27 additions and 3 deletions

View File

@@ -86,11 +86,12 @@ public abstract class AopProxyUtils {
Class<?> targetClass = advised.getTargetClass();
if (targetClass != null) {
if (targetClass.isInterface()) {
specifiedInterfaces = new Class<?>[] {targetClass};
advised.setInterfaces(targetClass);
}
else if (Proxy.isProxyClass(targetClass)) {
specifiedInterfaces = targetClass.getInterfaces();
advised.setInterfaces(targetClass.getInterfaces());
}
specifiedInterfaces = advised.getProxiedInterfaces();
}
}
boolean addSpringProxy = !advised.isInterfaceProxied(SpringProxy.class);