]> source.dussan.org Git - aspectj.git/commitdiff
Fix for preventing the use of if/target/this/args/cflow/cflowbelow in DeclareSofts.
authoraclement <aclement>
Thu, 26 Feb 2004 09:58:14 +0000 (09:58 +0000)
committeraclement <aclement>
Thu, 26 Feb 2004 09:58:14 +0000 (09:58 +0000)
(I hope putting this utility method in the Pointcut class is ok ...)

weaver/src/org/aspectj/weaver/patterns/Pointcut.java

index 6e3cf912fe027200e2c1a5bc00444608653196b3..c7c98b425e4a057aed2b9a5cc5ae27a24dc973db 100644 (file)
@@ -19,7 +19,10 @@ import java.io.IOException;
 
 import org.aspectj.util.FuzzyBoolean;
 import org.aspectj.util.TypeSafeEnum;
+import org.aspectj.weaver.Advice;
+import org.aspectj.weaver.AdviceKind;
 import org.aspectj.weaver.BCException;
+import org.aspectj.weaver.Checker;
 import org.aspectj.weaver.ISourceContext;
 import org.aspectj.weaver.IntMap;
 import org.aspectj.weaver.ResolvedTypeX;
@@ -119,6 +122,12 @@ public abstract class Pointcut extends PatternNode {
                return concretize(inAspect, map);
        }
        
+       public boolean isDeclare(ShadowMunger munger) {
+               if (munger == null) return false; // ??? Is it actually an error if we get a null munger into this method.
+               if (munger instanceof Checker) return true;
+               if (((Advice)munger).getKind().equals(AdviceKind.Softener)) return true;
+               return false;
+       }
        
        
        public Pointcut concretize(ResolvedTypeX inAspect, IntMap bindings) {