From: aclement Date: Thu, 10 Nov 2005 11:06:07 +0000 (+0000) Subject: fixes from AST bug: 110465. X-Git-Tag: V1_5_0RC1~211 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e433d6704633b9c3293f1b4c8507592ad987f2b8;p=aspectj.git fixes from AST bug: 110465. --- diff --git a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/InterTypeMethodDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/InterTypeMethodDeclaration.java index 192dbdbe8..e9f442370 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/InterTypeMethodDeclaration.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/InterTypeMethodDeclaration.java @@ -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 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 ea0fc5872..339b30db3 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 @@ -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$ }