From: aclement Date: Fri, 11 Nov 2005 08:16:23 +0000 (+0000) Subject: more AST stuff: 110465 X-Git-Tag: V1_5_0RC1~205 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1aeb7f3ef5dc07595dc35249316eaac62c7ba144;p=aspectj.git more AST stuff: 110465 --- diff --git a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/PointcutDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/PointcutDeclaration.java index d583a12e1..e11e520ea 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/PointcutDeclaration.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/PointcutDeclaration.java @@ -288,18 +288,20 @@ public class PointcutDeclaration extends BodyDeclaration { * Method declared on ASTNode. */ void accept0(ASTVisitor visitor) { - AjASTVisitor ajvis = ((AjASTVisitor)visitor); - boolean visitChildren = ajvis.visit(this); - if (visitChildren) { - // visit children in normal left to right reading order - acceptChild(ajvis, getJavadoc()); - if (this.ast.apiLevel >= AST.JLS3) { - acceptChildren(ajvis, this.modifiers); + if (visitor instanceof AjASTVisitor) { + AjASTVisitor ajvis = ((AjASTVisitor)visitor); + boolean visitChildren = ajvis.visit(this); + if (visitChildren) { + // visit children in normal left to right reading order + acceptChild(ajvis, getJavadoc()); + if (this.ast.apiLevel >= AST.JLS3) { + acceptChildren(ajvis, this.modifiers); + } + acceptChild(ajvis, getName()); + acceptChild(ajvis, getDesignator()); } - acceptChild(ajvis, getName()); - acceptChild(ajvis, getDesignator()); + ajvis.endVisit(this); } - ajvis.endVisit(this); } /* (omit javadoc for this method) 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 339b30db3..b16a3606e 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 @@ -65,6 +65,10 @@ public class ASTVisitorTest extends TestCase { check("aspect A{ /** */ public void B.x(){} }", "(compilationUnit(aspect(simpleName)(methodITD(primitiveType)(simpleName)(block))))"); } + + public void testAspectWithCommentThenPointcut() { + check("aspect A{ /** */ pointcut x(); }","(compilationUnit(aspect(simpleName)(pointcut(simpleName))))"); + } // original tests public void testAnInterface() {