adviceDecl = new org.aspectj.org.eclipse.jdt.core.dom.AfterAdviceDeclaration(this.ast);
} else if (adviceDeclaration.kind.equals(AdviceKind.AfterThrowing)){
adviceDecl = new AfterThrowingAdviceDeclaration(this.ast);
+ if (adviceDeclaration.extraArgument != null) {
SingleVariableDeclaration throwing = convert(adviceDeclaration.extraArgument);
((AfterThrowingAdviceDeclaration)adviceDecl).setThrowing(throwing);
+ }
} else if (adviceDeclaration.kind.equals(AdviceKind.AfterReturning)){
adviceDecl = new AfterReturningAdviceDeclaration(this.ast);
+ if (adviceDeclaration.extraArgument != null) {
SingleVariableDeclaration returning = convert(adviceDeclaration.extraArgument);
((AfterReturningAdviceDeclaration)adviceDecl).setReturning(returning);
+ }
} else if (adviceDeclaration.kind.equals(AdviceKind.Around)){
adviceDecl = new AroundAdviceDeclaration(this.ast);
// set the returnType
check("aspect A {pointcut a();after():a(){}}",
"(compilationUnit(aspect(simpleName)(pointcut(simpleName))(afterAdvice(simpleName)(block))))");
}
+ public void testAfterThrowingAdviceWithNoArgument() {
+ check("aspect A {pointcut a();after()throwing:a(){} }",
+ "(compilationUnit(aspect(simpleName)(pointcut(simpleName))(afterThrowingAdvice(simpleName)(block))))");
+ }
public void testAfterThrowingAdvice() {
check("aspect A {pointcut a();after()throwing(Exception e):a(){} }",
"(compilationUnit(aspect(simpleName)(pointcut(simpleName))(afterThrowingAdvice(simpleName)(simpleName)(simpleName)(block))))");
}
+ public void testAfterReturningAdviceWithNoArgument() {
+ check("aspect A {pointcut a();after()returning:a(){}}",
+ "(compilationUnit(aspect(simpleName)(pointcut(simpleName))(afterReturningAdvice(simpleName)(block))))");
+ }
public void testAfterReturningAdvice() {
check("aspect A {pointcut a();after()returning(Object o):a(){}}",
"(compilationUnit(aspect(simpleName)(pointcut(simpleName))(afterReturningAdvice(simpleName)(simpleName)(simpleName)(block))))");