]> source.dussan.org Git - aspectj.git/commitdiff
fixes from AST bug: 110465.
authoraclement <aclement>
Thu, 10 Nov 2005 11:06:07 +0000 (11:06 +0000)
committeraclement <aclement>
Thu, 10 Nov 2005 11:06:07 +0000 (11:06 +0000)
org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/InterTypeMethodDeclaration.java
org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/ASTVisitorTest.java

index 192dbdbe845578aef616f8be3d5830c45fb79f12..e9f44237014bb4da510e05fb5bef5b9536714b8e 100644 (file)
@@ -64,11 +64,12 @@ public class InterTypeMethodDeclaration extends MethodDeclaration {
                return result;
        }
        
+       
+       
        /* (omit javadoc for this method)
         * Method declared on ASTNode.
         */
-       void accept0(ASTVisitor visitor) {
-               AjASTVisitor ajvis = (AjASTVisitor)visitor;
+       void accept0(ASTVisitor ajvis) { 
                boolean visitChildren = ajvis.visit(this);
                if (visitChildren) {
                        // visit children in normal left to right reading order
index ea0fc5872e2da8897cd7e90a3b199b566aeb6210..339b30db314587bc07baf61087a716ccef33ff15 100644 (file)
@@ -25,6 +25,7 @@ import org.aspectj.org.eclipse.jdt.core.dom.AroundAdviceDeclaration;
 import org.aspectj.org.eclipse.jdt.core.dom.Assignment;
 import org.aspectj.org.eclipse.jdt.core.dom.BeforeAdviceDeclaration;
 import org.aspectj.org.eclipse.jdt.core.dom.Block;
+import org.aspectj.org.eclipse.jdt.core.dom.BlockComment;
 import org.aspectj.org.eclipse.jdt.core.dom.BodyDeclaration;
 import org.aspectj.org.eclipse.jdt.core.dom.CompilationUnit;
 import org.aspectj.org.eclipse.jdt.core.dom.DeclareDeclaration;
@@ -55,15 +56,15 @@ import org.aspectj.weaver.patterns.DeclareSoft;
 public class ASTVisitorTest extends TestCase {
        
     // from bug 110465 - will currently break because of casts
-//     public void testAspectWithITD() {
-//             check("aspect A{ public void B.x(){} }",
-//                       "(compilationUnit(aspect(simpleName)(methodITD(primitiveType)(simpleName)(block))))");
-//     }
-//     
-//     public void testAspectWithCommentThenITD() {
-//             check("aspect A{ /** */ public void B.x(){} }","yyy");
-//     }
+       public void testAspectWithITD() {
+               check("aspect A{ public void B.x(){} }",
+                         "(compilationUnit(aspect(simpleName)(methodITD(primitiveType)(simpleName)(block))))");
+       }
        
+       public void testAspectWithCommentThenITD() {
+               check("aspect A{ /** */ public void B.x(){} }",
+                         "(compilationUnit(aspect(simpleName)(methodITD(primitiveType)(simpleName)(block))))");
+       }
                                
        // original tests
        public void testAnInterface() {
@@ -514,6 +515,13 @@ class TestVisitor extends AjASTVisitor {
                b.append("(variableDeclaration"); //$NON-NLS-1$
                return isVisitingChildren();
        }
+       public boolean visit(BlockComment bc) {
+               b.append("(blockcomment");
+               return isVisitingChildren();
+       }
+       public void endVisit(BlockComment bc) {
+               b.append(")");
+       }
        public void endVisit(VariableDeclaration node) {
                b.append(")"); //$NON-NLS-1$
        }