Skip to content

Commit

Permalink
Simplify AdvisedSupport.removeAdvisor()
Browse files Browse the repository at this point in the history
Closes gh-24205
  • Loading branch information
stsypanov authored and sbrannen committed Dec 13, 2019
1 parent 17edbec commit d9cae33
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -283,16 +283,16 @@ public void removeAdvisor(int index) throws AopConfigException {
"This configuration only has " + this.advisors.size() + " advisors.");
}

Advisor advisor = this.advisors.get(index);
Advisor advisor = this.advisors.remove(index);
if (advisor instanceof IntroductionAdvisor) {
IntroductionAdvisor ia = (IntroductionAdvisor) advisor;
// We need to remove introduction interfaces.
for (int j = 0; j < ia.getInterfaces().length; j++) {
removeInterface(ia.getInterfaces()[j]);
Class<?>[] interfaces = ia.getInterfaces();
for (Class<?> iface : interfaces) {
removeInterface(iface);
}
}

this.advisors.remove(index);
updateAdvisorArray();
adviceChanged();
}
Expand Down

0 comments on commit d9cae33

Please sign in to comment.