]> source.dussan.org Git - aspectj.git/commitdiff
more AST stuff: 110465
authoraclement <aclement>
Fri, 11 Nov 2005 08:16:23 +0000 (08:16 +0000)
committeraclement <aclement>
Fri, 11 Nov 2005 08:16:23 +0000 (08:16 +0000)
org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/PointcutDeclaration.java
org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/ASTVisitorTest.java

index d583a12e1def357531a1b190d2f1c4acbda1d547..e11e520ea86bcca34f1de920868a929c0c82f6df 100644 (file)
@@ -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)
index 339b30db314587bc07baf61087a716ccef33ff15..b16a3606ee877f6cc8677d816ce2e486d4989f91 100644 (file)
@@ -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() {