Support method validation for interface-only proxies

Closes gh-29782
This commit is contained in:
rstoyanchev
2023-01-27 14:45:40 +00:00
parent 7da6e93597
commit 6a6a35a0b9
3 changed files with 71 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -97,6 +97,11 @@ public abstract class AbstractAdvisingBeanPostProcessor extends ProxyProcessorSu
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
advised.addAdvisor(advised.getAdvisorCount() - 1, this.advisor);
return bean;
}
else {
advised.addAdvisor(this.advisor);
}