summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2005-12-13 08:50:36 +0000
committeraclement <aclement>2005-12-13 08:50:36 +0000
commit3eb0e5addb26cf4f8a9a66795581c01a60adce63 (patch)
treed3eda391943a92cf364b1931cabdd2b42e5c3ffc
parent47d86c624fa68424fb0d4d440eb188df77664c0b (diff)
downloadaspectj-3eb0e5addb26cf4f8a9a66795581c01a60adce63.tar.gz
aspectj-3eb0e5addb26cf4f8a9a66795581c01a60adce63.zip
AST fixes: 110465 - from helen.
-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))))");