if (world.isInJava5Mode() && world.getLint().adviceDidNotMatch.isEnabled()) {
List l = world.getCrosscuttingMembersSet().getShadowMungers();
Set<AdviceLocation> alreadyWarnedLocations = new HashSet<AdviceLocation>();
for (Iterator iter = l.iterator(); iter.hasNext();) {
ShadowMunger element = (ShadowMunger) iter.next();
// This will stop us incorrectly reporting deow checkers:
if (element instanceof BcelAdvice) {
BcelAdvice ba = (BcelAdvice) element;
if (ba.getKind() == AdviceKind.CflowEntry || ba.getKind() == AdviceKind.CflowBelowEntry) {
continue;
}
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) {
// check we haven't already warned on this advice and line
// (cflow creates multiple mungers for the same advice)
AdviceLocation loc = new AdviceLocation(ba);
if (alreadyWarnedLocations.contains(loc)) {
continue;
} else {
alreadyWarnedLocations.add(loc);
}
if (!(ba.getSignature() instanceof BcelMethod)
|| !Utility.isSuppressing(ba.getSignature(), "adviceDidNotMatch")) {
world.getLint().adviceDidNotMatch.signal(ba.getDeclaringAspect().toString(), new SourceLocation(
element.getSourceLocation().getSourceFile(), element.getSourceLocation().getLine()));
}
}
}
}
}