Object a = mungers.get(i);
Object b = mungers.get(j);
// Make sure they are the right type
if (a instanceof BcelAdvice && b instanceof BcelAdvice) {
BcelAdvice adviceA = (BcelAdvice)a;
BcelAdvice adviceB = (BcelAdvice)b;
if (!adviceA.concreteAspect.equals(adviceB.concreteAspect)) {
AdviceKind adviceKindA = adviceA.getKind();
AdviceKind adviceKindB = adviceB.getKind();
// make sure they are the nice ones (<6) and not any synthetic advice ones we
// create to support other features of the language.
if (adviceKindA.getKey()<(byte)6 && adviceKindB.getKey()<(byte)6 &&
adviceKindA.getPrecedence() == adviceKindB.getPrecedence()) {
// Ask the world if it knows about precedence between these
Integer order = getIWorld().getPrecedenceIfAny(
adviceA.concreteAspect,
adviceB.concreteAspect);
if (order!=null &&
order.equals(new Integer(0))) {
String key = adviceA.getDeclaringAspect()+":"+adviceB.getDeclaringAspect();
String possibleExistingKey = adviceB.getDeclaringAspect()+":"+adviceA.getDeclaringAspect();
if (!clashingAspects.contains(possibleExistingKey)) clashingAspects.add(key);
}
}
}
}