Polishing

This commit is contained in:
Juergen Hoeller
2023-01-31 16:14:32 +01:00
parent 4d6249811e
commit c0c9ba5c2c
7 changed files with 23 additions and 21 deletions

View File

@@ -93,12 +93,13 @@ public abstract class AbstractAdvisingBeanPostProcessor extends ProxyProcessorSu
if (bean instanceof Advised advised) {
if (!advised.isFrozen() && isEligible(AopUtils.getTargetClass(bean))) {
// Add our local Advisor to the existing proxy's Advisor chain...
// Add our local Advisor to the existing proxy's Advisor chain.
if (this.beforeExistingAdvisors) {
advised.addAdvisor(0, this.advisor);
}
else if (advised.getTargetSource() == AdvisedSupport.EMPTY_TARGET_SOURCE && advised.getAdvisorCount() > 0) {
// No target, leave last advisor in place
else if (advised.getTargetSource() == AdvisedSupport.EMPTY_TARGET_SOURCE &&
advised.getAdvisorCount() > 0) {
// No target, leave last Advisor in place and add new Advisor right before.
advised.addAdvisor(advised.getAdvisorCount() - 1, this.advisor);
return bean;
}