PrecedenceCacheKey key = new PrecedenceCacheKey(firstAspect, secondAspect);
if (cachedResults.containsKey(key)) {
return ((Integer) cachedResults.get(key)).intValue();
} else {
int order = 0;
DeclarePrecedence orderer = null; // Records the declare
// precedence statement that
// gives the first ordering
for (Iterator i = world.getCrosscuttingMembersSet().getDeclareDominates().iterator(); i.hasNext();) {
DeclarePrecedence d = (DeclarePrecedence) i.next();
int thisOrder = d.compare(firstAspect, secondAspect);
if (thisOrder != 0) {
if (orderer == null) {
orderer = d;
}
if (order != 0 && order != thisOrder) {
ISourceLocation[] isls = new ISourceLocation[2];
isls[0] = orderer.getSourceLocation();
isls[1] = d.getSourceLocation();
Message m = new Message("conflicting declare precedence orderings for aspects: "
+ firstAspect.getName() + " and " + secondAspect.getName(), null, true, isls);
world.getMessageHandler().handleMessage(m);
} else {
order = thisOrder;