[jboss-cvs] JBossAS SVN: r64145 - projects/aop/trunk/aop/src/main/org/jboss/aop/advice.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jul 19 16:20:48 EDT 2007


Author: adrian at jboss.org
Date: 2007-07-19 16:20:47 -0400 (Thu, 19 Jul 2007)
New Revision: 64145

Modified:
   projects/aop/trunk/aop/src/main/org/jboss/aop/advice/AspectDefinition.java
Log:
Fix the broken iterator usage.

Modified: projects/aop/trunk/aop/src/main/org/jboss/aop/advice/AspectDefinition.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/advice/AspectDefinition.java	2007-07-19 18:30:52 UTC (rev 64144)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/advice/AspectDefinition.java	2007-07-19 20:20:47 UTC (rev 64145)
@@ -73,33 +73,31 @@
             Advisor advisor = (Advisor)it.next();
             if (advisor != null)
             {
-               if (advisors.remove(advisor) !=  null)
+               it.remove();
+               if (scope == Scope.PER_INSTANCE)
                {
-                  if (scope == Scope.PER_INSTANCE)
+                  advisor.removePerInstanceAspect(this);
+               }
+               else if (scope == Scope.PER_JOINPOINT)
+               {
+                  advisor.removePerInstanceJoinpointAspect(this);
+               }
+               else if (scope == Scope.PER_CLASS)
+               {
+                  advisor.removePerClassAspect(this);
+                  if (advisor instanceof GeneratedClassAdvisor)
                   {
-                     advisor.removePerInstanceAspect(this);
+                     //If it was a PER_JOINPOINT aspect for a static member, it might be listed under PER_CLASS_JOINPOINT as well
+                     ((GeneratedClassAdvisor)advisor).removePerClassJoinpointAspect(this);
                   }
-                  else if (scope == Scope.PER_JOINPOINT)
+               }
+               else if (scope == Scope.PER_CLASS_JOINPOINT)
+               {
+                  if (advisor instanceof GeneratedClassAdvisor)
                   {
-                     advisor.removePerInstanceJoinpointAspect(this);
+                     //GeneratedClassAdvisors handle PER_CLASS_JOINPOINT aspects slightly differently
+                     ((GeneratedClassAdvisor)advisor).removePerClassJoinpointAspect(this);
                   }
-                  else if (scope == Scope.PER_CLASS)
-                  {
-                     advisor.removePerClassAspect(this);
-                     if (advisor instanceof GeneratedClassAdvisor)
-                     {
-                        //If it was a PER_JOINPOINT aspect for a static member, it might be listed under PER_CLASS_JOINPOINT as well
-                        ((GeneratedClassAdvisor)advisor).removePerClassJoinpointAspect(this);
-                     }
-                  }
-                  else if (scope == Scope.PER_CLASS_JOINPOINT)
-                  {
-                     if (advisor instanceof GeneratedClassAdvisor)
-                     {
-                        //GeneratedClassAdvisors handle PER_CLASS_JOINPOINT aspects slightly differently
-                        ((GeneratedClassAdvisor)advisor).removePerClassJoinpointAspect(this);
-                     }
-                  }
                }
             }
          }




More information about the jboss-cvs-commits mailing list