aboutsummaryrefslogtreecommitdiffstats
path: root/weaver
diff options
context:
space:
mode:
authoraclement <aclement>2005-05-09 11:08:28 +0000
committeraclement <aclement>2005-05-09 11:08:28 +0000
commitf6034581d8540124494806a7c6b3ad37ead2b6c3 (patch)
tree158298c44f78ba53dfb1cd95ccde8c1f01cafa87 /weaver
parent51c018d9bbf0ecfb312cb2b56112c71cfc516c53 (diff)
downloadaspectj-f6034581d8540124494806a7c6b3ad37ead2b6c3.tar.gz
aspectj-f6034581d8540124494806a7c6b3ad37ead2b6c3.zip
tests and fixes for 93345 and static imports. From Andrew Huff.
Diffstat (limited to 'weaver')
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java19
1 files changed, 10 insertions, 9 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java b/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
index 028b229b0..b32ebc0c7 100644
--- a/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
+++ b/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
@@ -995,6 +995,7 @@ public class BcelWeaver implements IWeaver {
deletedTypenames = new ArrayList();
+ // FIXME asc Should be factored out into Xlint code and done automatically for all xlint messages, ideally.
// if a piece of advice hasn't matched anywhere and we are in -1.5 mode, put out a warning
if (world.behaveInJava5Way &&
world.getLint().adviceDidNotMatch.isEnabled()) {
@@ -1003,15 +1004,15 @@ public class BcelWeaver implements IWeaver {
ShadowMunger element = (ShadowMunger) iter.next();
if (element instanceof BcelAdvice) { // This will stop us incorrectly reporting deow Checkers
BcelAdvice ba = (BcelAdvice)element;
- if (!ba.hasMatchedSomething()) {
- BcelMethod meth = (BcelMethod)ba.getSignature();
- if (meth!=null) {
- AnnotationX[] anns = (AnnotationX[])meth.getAnnotations();
- // Check if they want to suppress the warning on this piece of advice
- if (!Utility.isSuppressing(anns,"adviceDidNotMatch")) {
- world.getLint().adviceDidNotMatch.signal(ba.getDeclaringAspect().toString(),element.getSourceLocation());
- }
- }
+ if (!ba.hasMatchedSomething()) {
+ // Because we implement some features of AJ itself by creating our own kind of mungers, you sometimes
+ // find that ba.getSignature() is not a BcelMethod - for example it might be a cflow entry munger.
+ if (ba.getSignature()!=null) {
+ if (!(ba.getSignature() instanceof BcelMethod)
+ || !Utility.isSuppressing((AnnotationX[])ba.getSignature().getAnnotations(),"adviceDidNotMatch")) {
+ world.getLint().adviceDidNotMatch.signal(ba.getDeclaringAspect().toString(),element.getSourceLocation());
+ }
+ }
}
}
}