Simplify AdvisedSupport.removeAdvisor()

Closes gh-24205
This commit is contained in:
Сергей Цыпанов 2019-12-13 18:12:18 +02:00 committed by Sam Brannen
parent 17edbec035
commit d9cae339d6
1 changed files with 4 additions and 4 deletions

View File

@ -283,16 +283,16 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
"This configuration only has " + this.advisors.size() + " advisors."); "This configuration only has " + this.advisors.size() + " advisors.");
} }
Advisor advisor = this.advisors.get(index); Advisor advisor = this.advisors.remove(index);
if (advisor instanceof IntroductionAdvisor) { if (advisor instanceof IntroductionAdvisor) {
IntroductionAdvisor ia = (IntroductionAdvisor) advisor; IntroductionAdvisor ia = (IntroductionAdvisor) advisor;
// We need to remove introduction interfaces. // We need to remove introduction interfaces.
for (int j = 0; j < ia.getInterfaces().length; j++) { Class<?>[] interfaces = ia.getInterfaces();
removeInterface(ia.getInterfaces()[j]); for (Class<?> iface : interfaces) {
removeInterface(iface);
} }
} }
this.advisors.remove(index);
updateAdvisorArray(); updateAdvisorArray();
adviceChanged(); adviceChanged();
} }