retitle warning to "circular {advice} dependency at ..."tags/Root_ajdt_support
<message kind="warning" line="6"/> | <message kind="warning" line="6"/> | ||||
</compile> | </compile> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs" pr="44272" | |||||
title="retitle warning to circular {advice} dependency at ..."> | |||||
<compile files="CircularAdvicePrecedence.java"> | |||||
<message kind="error" line="4"/> | |||||
<message kind="error" line="5"/> | |||||
<message kind="error" line="6"/> | |||||
</compile> | |||||
</ajc-test> | |||||
</suite> | </suite> |
// bug 44272 | |||||
public aspect CircularAdvicePrecedence { | |||||
pointcut crun() : execution (void run()) ; | |||||
before() : crun() {} | |||||
after() returning : crun() {} | |||||
void around() : crun() { proceed(); } | |||||
} | |||||
class Runner { | |||||
public void run() {} | |||||
} |
for (Iterator i = mungers.iterator(); i.hasNext(); ) { | for (Iterator i = mungers.iterator(); i.hasNext(); ) { | ||||
ShadowMunger m = (ShadowMunger)i.next(); | ShadowMunger m = (ShadowMunger)i.next(); | ||||
getIWorld().getMessageHandler().handleMessage( | getIWorld().getMessageHandler().handleMessage( | ||||
MessageUtil.error("circular dependency at " + this, m.getSourceLocation())); | |||||
MessageUtil.error("circular advice dependency at " + this, m.getSourceLocation())); | |||||
} | } | ||||
} | } | ||||
mungers = sorted; | mungers = sorted; |
if (pi.isStar()) { | if (pi.isStar()) { | ||||
if (seenStar) { | if (seenStar) { | ||||
scope.getWorld().showMessage(IMessage.ERROR, | scope.getWorld().showMessage(IMessage.ERROR, | ||||
"circularity in declare dominates, '*' occurs more than once", | |||||
"circularity in declare precedence, '*' occurs more than once", | |||||
pi.getSourceLocation(), null); | pi.getSourceLocation(), null); | ||||
} | } | ||||
seenStar = true; | seenStar = true; | ||||
if (pj.isStar()) continue; | if (pj.isStar()) continue; | ||||
if (pj.matchesStatically(exactType)) { | if (pj.matchesStatically(exactType)) { | ||||
scope.getWorld().showMessage(IMessage.ERROR, | scope.getWorld().showMessage(IMessage.ERROR, | ||||
"circularity in declare dominates, '" + exactType.getName() + | |||||
"circularity in declare precedence, '" + exactType.getName() + | |||||
"' matches two patterns", pi.getSourceLocation(), pj.getSourceLocation()); | "' matches two patterns", pi.getSourceLocation(), pj.getSourceLocation()); | ||||
} | } | ||||
} | } |