Project: AspectJ
Bug 211674 [ataspectj] after throwing annotation style is too sensitive to parameter positions
Reported: 2007-12-01 13:15:13 | Status: resolved fixed

Reported on the list by Ashley Williams: Having converted my aspects to use the @AspectJ style, I'm now getting a strange error message when a compile my tracing aspect,. First here is the section of code: @Pointcut("execution(@Tracing * *(..)) && @annotation(tracing)") void annotatedMethods(Tracing tracing) { } @AfterThrowing(pointcut = "annotatedMethods(tracing)", throwing = "t") public void logException(JoinPoint thisJoinPoint, Tracing tracing, Throwable t) { Level level = Level.toLevel(tracing.level()); if (logger.isEnabledFor(level)) { logger.log(level, formatter.formatSignatureThrowing(thisJoinPoint), t); } } So I am matching on all methods annotated with @Tracing and logging the subclass of Throwable that may have been thrown. However when I run my test case i get the following error: java.lang.VerifyError: (class: com/db/abfo/tracing/PojoOne, method: calculate signature: ()V) catch_type not a subclass of Throwable This used to work when I used the aspectj after throwing language extention form: pointcut annotatedMethods(Tracing tracing) : execution(@Tracing * *(..)) && @annotation(tracing); after(Tracing tracing) throwing(Throwable t) : annotatedMethods(tracing) { Level level = tracing.level().getLevel(); if (logger.isEnabledFor(level)) { logger.log(level, formatter.formatSignatureThrowing(thisJoinPoint), t); } }

Files changed in fix:
tests/bugs154/pr211674/Test.java tests/bugs154/pr211674/Test2.java tests/src/org/aspectj/systemtest/ajc154/Ajc154Tests.java