aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AjASTConverter.java4
-rw-r--r--org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/ASTVisitorTest.java8
2 files changed, 12 insertions, 0 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AjASTConverter.java b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AjASTConverter.java
index 5ac6e9204..98fc374b6 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AjASTConverter.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AjASTConverter.java
@@ -72,12 +72,16 @@ public class AjASTConverter extends ASTConverter {
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
diff --git a/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/ASTVisitorTest.java b/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/ASTVisitorTest.java
index b16a3606e..33ffbfd2d 100644
--- a/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/ASTVisitorTest.java
+++ b/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/ASTVisitorTest.java
@@ -102,10 +102,18 @@ public class ASTVisitorTest extends TestCase {
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))))");