From: aclement Date: Wed, 11 Jun 2008 21:43:38 +0000 (+0000) Subject: 234933: test and partial fix, just for adviceDidNotMatch so far. X-Git-Tag: V1_6_1rc1~60 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0ed0600a2bb9c08b530120ffbf9b18dad613a108;p=aspectj.git 234933: test and partial fix, just for adviceDidNotMatch so far. --- diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java b/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java index 0b7880fed..68a32374c 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java @@ -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()); } diff --git a/weaver/src/org/aspectj/weaver/bcel/Utility.java b/weaver/src/org/aspectj/weaver/bcel/Utility.java index 68193a060..6d2a98f71 100644 --- a/weaver/src/org/aspectj/weaver/bcel/Utility.java +++ b/weaver/src/org/aspectj/weaver/bcel/Utility.java @@ -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