]> source.dussan.org Git - aspectj.git/commitdiff
Flag indicating if this advice actually matched anything at all.
authoraclement <aclement>
Thu, 17 Feb 2005 15:12:07 +0000 (15:12 +0000)
committeraclement <aclement>
Thu, 17 Feb 2005 15:12:07 +0000 (15:12 +0000)
weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java

index 344602d97c314a952d03e6bcf1b4adf6edfaccce..948fc536aa1264c3010a51e0bcff78c96f601c77 100644 (file)
@@ -49,6 +49,8 @@ import org.aspectj.weaver.patterns.Pointcut;
 public class BcelAdvice extends Advice {
        private Test pointcutTest;
        private ExposedState exposedState;
+    
+    private boolean hasMatchedAtLeastOnce = false;
 
        public BcelAdvice(
                AjAttribute.AdviceAttribute attribute,
@@ -131,6 +133,7 @@ public class BcelAdvice extends Advice {
     }
 
     public void implementOn(Shadow s) {
+        hasMatchedAtLeastOnce=true;
         BcelShadow shadow = (BcelShadow) s;       
         if (getKind() == AdviceKind.Before) {
             shadow.weaveBefore(this);
@@ -425,5 +428,9 @@ public class BcelAdvice extends Advice {
                }
                return ret; //(BcelVar[]) exposedState.vars;
        }
+       
+       public boolean hasMatchedSomething() {
+               return hasMatchedAtLeastOnce;
+       }
 
 }