]> source.dussan.org Git - aspectj.git/commitdiff
234933: test and partial fix, just for adviceDidNotMatch so far.
authoraclement <aclement>
Wed, 11 Jun 2008 21:43:38 +0000 (21:43 +0000)
committeraclement <aclement>
Wed, 11 Jun 2008 21:43:38 +0000 (21:43 +0000)
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
weaver/src/org/aspectj/weaver/bcel/Utility.java

index 0b7880fedccd072b61b623d5bf46f7b6a15a98f8..68a32374c7094c2c52cf9782806b9a092ed48f91 100644 (file)
@@ -1284,7 +1284,7 @@ public class BcelWeaver {
                           }
                                 
                                           if (!(ba.getSignature() instanceof BcelMethod)
-                                              || !Utility.isSuppressing((AnnotationX[])ba.getSignature().getAnnotations(),"adviceDidNotMatch")) {
+                                                      || !Utility.isSuppressing(ba.getSignature(),"adviceDidNotMatch")) {
                                                world.getLint().adviceDidNotMatch.signal(ba.getDeclaringAspect().toString(),
                                                                new SourceLocation(element.getSourceLocation().getSourceFile(),element.getSourceLocation().getLine()));//element.getSourceLocation());
                                           }                                                      
index 68193a060913e54640560b63c61eea40187654ac..6d2a98f71af2d3bc669e2b6263c88ffb88ed894c 100644 (file)
@@ -727,6 +727,19 @@ public class Utility {
                return ((ii&Constants.PUSH_INST)!=0 && (ii&Constants.CONSTANT_INST)!=0);
        }
        
+       /**
+        * Checks for suppression specified on the member or on the declaring type of that member
+        */
+       public static boolean isSuppressing(Member member,String lintkey) {
+               boolean isSuppressing = Utility.isSuppressing(member.getAnnotations(), lintkey);
+               if (isSuppressing) return true;
+               UnresolvedType type = member.getDeclaringType();
+               if (type instanceof ResolvedType) {
+                       return Utility.isSuppressing(((ResolvedType)type).getAnnotations(),lintkey);            
+               }
+               return false;
+       }
+
        /**
      * Check if the annotations contain a SuppressAjWarnings annotation and
      * if that annotation specifies that the given lint message (identified