From ed1585ae59552692c892bca34bd61e47b5da7f3e Mon Sep 17 00:00:00 2001 From: aclement Date: Fri, 11 Nov 2005 08:29:32 +0000 Subject: [PATCH] more AST stuff: 110465 --- .../jdt/core/dom/AfterAdviceDeclaration.java | 20 +++++----- .../dom/AfterReturningAdviceDeclaration.java | 22 ++++++----- .../dom/AfterThrowingAdviceDeclaration.java | 22 ++++++----- .../org/eclipse/jdt/core/dom/AndPointcut.java | 16 ++++---- .../jdt/core/dom/AroundAdviceDeclaration.java | 30 ++++++++------- .../jdt/core/dom/BeforeAdviceDeclaration.java | 20 +++++----- .../eclipse/jdt/core/dom/CflowPointcut.java | 14 ++++--- .../jdt/core/dom/DeclareDeclaration.java | 12 +++--- .../eclipse/jdt/core/dom/DefaultPointcut.java | 6 ++- .../core/dom/InterTypeFieldDeclaration.java | 20 +++++----- .../core/dom/InterTypeMethodDeclaration.java | 37 ++++++++++--------- .../org/eclipse/jdt/core/dom/NotPointcut.java | 14 ++++--- .../org/eclipse/jdt/core/dom/OrPointcut.java | 16 ++++---- .../org/eclipse/jdt/core/dom/PerCflow.java | 14 ++++--- .../org/eclipse/jdt/core/dom/PerObject.java | 14 ++++--- .../eclipse/jdt/core/dom/PerTypeWithin.java | 12 +++--- .../jdt/core/dom/ReferencePointcut.java | 14 ++++--- 17 files changed, 169 insertions(+), 134 deletions(-) diff --git a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AfterAdviceDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AfterAdviceDeclaration.java index 9a128d6df..eed69d89c 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AfterAdviceDeclaration.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AfterAdviceDeclaration.java @@ -49,15 +49,17 @@ public class AfterAdviceDeclaration extends AdviceDeclaration { * Method declared on ASTNode. */ void accept0(ASTVisitor visitor) { - boolean visitChildren = ((AjASTVisitor)visitor).visit(this); - if (visitChildren) { - // visit children in normal left to right reading order - acceptChild(visitor, getJavadoc()); - acceptChildren(visitor, this.parameters); - acceptChild(visitor, getPointcut()); - acceptChildren(visitor, this.thrownExceptions); - acceptChild(visitor, getBody()); + if (visitor instanceof AjASTVisitor) { + boolean visitChildren = ((AjASTVisitor)visitor).visit(this); + if (visitChildren) { + // visit children in normal left to right reading order + acceptChild(visitor, getJavadoc()); + acceptChildren(visitor, this.parameters); + acceptChild(visitor, getPointcut()); + acceptChildren(visitor, this.thrownExceptions); + acceptChild(visitor, getBody()); + } + ((AjASTVisitor)visitor).endVisit(this); } - ((AjASTVisitor)visitor).endVisit(this); } } diff --git a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AfterReturningAdviceDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AfterReturningAdviceDeclaration.java index 508e80d82..f78e2a2a8 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AfterReturningAdviceDeclaration.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AfterReturningAdviceDeclaration.java @@ -133,16 +133,18 @@ public class AfterReturningAdviceDeclaration extends AfterAdviceDeclaration { } void accept0(ASTVisitor visitor) { - boolean visitChildren = ((AjASTVisitor)visitor).visit(this); - if (visitChildren) { - // visit children in normal left to right reading order - acceptChild(visitor, getJavadoc()); - acceptChildren(visitor, this.parameters); - acceptChild(visitor, getPointcut()); - acceptChild(visitor, getReturning()); - acceptChildren(visitor, this.thrownExceptions); - acceptChild(visitor, getBody()); + if (visitor instanceof AjASTVisitor) { + boolean visitChildren = ((AjASTVisitor)visitor).visit(this); + if (visitChildren) { + // visit children in normal left to right reading order + acceptChild(visitor, getJavadoc()); + acceptChildren(visitor, this.parameters); + acceptChild(visitor, getPointcut()); + acceptChild(visitor, getReturning()); + acceptChildren(visitor, this.thrownExceptions); + acceptChild(visitor, getBody()); + } + ((AjASTVisitor)visitor).endVisit(this); } - ((AjASTVisitor)visitor).endVisit(this); } } \ No newline at end of file diff --git a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AfterThrowingAdviceDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AfterThrowingAdviceDeclaration.java index 9d62d92b9..0d5142278 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AfterThrowingAdviceDeclaration.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AfterThrowingAdviceDeclaration.java @@ -132,16 +132,18 @@ public class AfterThrowingAdviceDeclaration extends AfterAdviceDeclaration { } void accept0(ASTVisitor visitor) { - boolean visitChildren = ((AjASTVisitor)visitor).visit(this); - if (visitChildren) { - // visit children in normal left to right reading order - acceptChild(visitor, getJavadoc()); - acceptChildren(visitor, this.parameters); - acceptChild(visitor, getPointcut()); - acceptChild(visitor, getThrowing()); - acceptChildren(visitor, this.thrownExceptions); - acceptChild(visitor, getBody()); + if (visitor instanceof AjASTVisitor) { + boolean visitChildren = ((AjASTVisitor)visitor).visit(this); + if (visitChildren) { + // visit children in normal left to right reading order + acceptChild(visitor, getJavadoc()); + acceptChildren(visitor, this.parameters); + acceptChild(visitor, getPointcut()); + acceptChild(visitor, getThrowing()); + acceptChildren(visitor, this.thrownExceptions); + acceptChild(visitor, getBody()); + } + ((AjASTVisitor)visitor).endVisit(this); } - ((AjASTVisitor)visitor).endVisit(this); } } \ No newline at end of file diff --git a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AndPointcut.java b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AndPointcut.java index d0e0fad0c..6caa20013 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AndPointcut.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AndPointcut.java @@ -105,14 +105,16 @@ public class AndPointcut extends PointcutDesignator { return ((AjASTMatcher)matcher).match(this, other); } void accept0(ASTVisitor visitor) { - boolean visitChildren = ((AjASTVisitor)visitor).visit(this); - if (visitChildren) { - // visit children in normal left to right reading order - acceptChild(visitor, getLeft()); - acceptChild(visitor, getRight()); - // todo: accept the parameters here + if (visitor instanceof AjASTVisitor) { + boolean visitChildren = ((AjASTVisitor)visitor).visit(this); + if (visitChildren) { + // visit children in normal left to right reading order + acceptChild(visitor, getLeft()); + acceptChild(visitor, getRight()); + // todo: accept the parameters here + } + ((AjASTVisitor)visitor).endVisit(this); } - ((AjASTVisitor)visitor).endVisit(this); } int treeSize() { return diff --git a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AroundAdviceDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AroundAdviceDeclaration.java index 7e367103b..915ab1a52 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AroundAdviceDeclaration.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AroundAdviceDeclaration.java @@ -239,21 +239,23 @@ public class AroundAdviceDeclaration extends AdviceDeclaration { * Method declared on ASTNode. */ void accept0(ASTVisitor visitor) { - boolean visitChildren = ((AjASTVisitor)visitor).visit(this); - if (visitChildren) { - // visit children in normal left to right reading order - acceptChild(visitor, getJavadoc()); - if (ast.apiLevel == AST.JLS2_INTERNAL) { - acceptChild(visitor, getReturnType()); - } else { - acceptChild(visitor, getReturnType2()); + if (visitor instanceof AjASTVisitor) { + boolean visitChildren = ((AjASTVisitor)visitor).visit(this); + if (visitChildren) { + // visit children in normal left to right reading order + acceptChild(visitor, getJavadoc()); + if (ast.apiLevel == AST.JLS2_INTERNAL) { + acceptChild(visitor, getReturnType()); + } else { + acceptChild(visitor, getReturnType2()); + } + + acceptChildren(visitor, this.parameters); + acceptChild(visitor, getPointcut()); + acceptChildren(visitor, this.thrownExceptions); + acceptChild(visitor, getBody()); } - - acceptChildren(visitor, this.parameters); - acceptChild(visitor, getPointcut()); - acceptChildren(visitor, this.thrownExceptions); - acceptChild(visitor, getBody()); + ((AjASTVisitor)visitor).endVisit(this); } - ((AjASTVisitor)visitor).endVisit(this); } } diff --git a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/BeforeAdviceDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/BeforeAdviceDeclaration.java index 4bd378d56..043dc9822 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/BeforeAdviceDeclaration.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/BeforeAdviceDeclaration.java @@ -49,15 +49,17 @@ public class BeforeAdviceDeclaration extends AdviceDeclaration { * Method declared on ASTNode. */ void accept0(ASTVisitor visitor) { - boolean visitChildren = ((AjASTVisitor)visitor).visit(this); - if (visitChildren) { - // visit children in normal left to right reading order - acceptChild(visitor, getJavadoc()); - acceptChildren(visitor, this.parameters); - acceptChild(visitor, getPointcut()); - acceptChildren(visitor, this.thrownExceptions); - acceptChild(visitor, getBody()); + if (visitor instanceof AjASTVisitor) { + boolean visitChildren = ((AjASTVisitor)visitor).visit(this); + if (visitChildren) { + // visit children in normal left to right reading order + acceptChild(visitor, getJavadoc()); + acceptChildren(visitor, this.parameters); + acceptChild(visitor, getPointcut()); + acceptChildren(visitor, this.thrownExceptions); + acceptChild(visitor, getBody()); + } + ((AjASTVisitor)visitor).endVisit(this); } - ((AjASTVisitor)visitor).endVisit(this); } } diff --git a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/CflowPointcut.java b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/CflowPointcut.java index f57c415a8..65b22b25e 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/CflowPointcut.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/CflowPointcut.java @@ -86,13 +86,15 @@ public class CflowPointcut extends PointcutDesignator { return ((AjASTMatcher)matcher).match(this, other); } void accept0(ASTVisitor visitor) { - boolean visitChildren = ((AjASTVisitor)visitor).visit(this); - if (visitChildren) { - // visit children in normal left to right reading order - acceptChild(visitor, getBody()); - // todo: accept the parameters here + if (visitor instanceof AjASTVisitor) { + boolean visitChildren = ((AjASTVisitor)visitor).visit(this); + if (visitChildren) { + // visit children in normal left to right reading order + acceptChild(visitor, getBody()); + // todo: accept the parameters here + } + ((AjASTVisitor)visitor).endVisit(this); } - ((AjASTVisitor)visitor).endVisit(this); } int treeSize() { return diff --git a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/DeclareDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/DeclareDeclaration.java index 04c309110..f33350582 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/DeclareDeclaration.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/DeclareDeclaration.java @@ -107,12 +107,14 @@ public class DeclareDeclaration extends BodyDeclaration { * Method declared on ASTNode. */ void accept0(ASTVisitor visitor) { - boolean visitChildren = ((AjASTVisitor)visitor).visit(this); - if (visitChildren) { - // visit children in normal left to right reading order - acceptChild(visitor, getJavadoc()); + if (visitor instanceof AjASTVisitor) { + boolean visitChildren = ((AjASTVisitor)visitor).visit(this); + if (visitChildren) { + // visit children in normal left to right reading order + acceptChild(visitor, getJavadoc()); + } + ((AjASTVisitor)visitor).endVisit(this); } - ((AjASTVisitor)visitor).endVisit(this); } /** diff --git a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/DefaultPointcut.java b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/DefaultPointcut.java index d7d5d6ee0..a81661272 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/DefaultPointcut.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/DefaultPointcut.java @@ -55,8 +55,10 @@ public class DefaultPointcut extends PointcutDesignator { return ((AjASTMatcher)matcher).match(this, other); } void accept0(ASTVisitor visitor) { - boolean visitChildren = ((AjASTVisitor)visitor).visit(this); - ((AjASTVisitor)visitor).endVisit(this); + if (visitor instanceof AjASTVisitor) { + boolean visitChildren = ((AjASTVisitor)visitor).visit(this); + ((AjASTVisitor)visitor).endVisit(this); + } } int treeSize() { return memSize(); diff --git a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/InterTypeFieldDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/InterTypeFieldDeclaration.java index 9b8e4cf36..5307c4bef 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/InterTypeFieldDeclaration.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/InterTypeFieldDeclaration.java @@ -49,16 +49,18 @@ public class InterTypeFieldDeclaration extends FieldDeclaration { } void accept0(ASTVisitor visitor) { - boolean visitChildren = ((AjASTVisitor)visitor).visit(this); - if (visitChildren) { - // visit children in normal left to right reading order - acceptChild(visitor, getJavadoc()); - if (this.ast.apiLevel >= AST.JLS3) { - acceptChildren(visitor, this.modifiers); + if (visitor instanceof AjASTVisitor) { + boolean visitChildren = ((AjASTVisitor)visitor).visit(this); + if (visitChildren) { + // visit children in normal left to right reading order + acceptChild(visitor, getJavadoc()); + if (this.ast.apiLevel >= AST.JLS3) { + acceptChildren(visitor, this.modifiers); + } + acceptChild(visitor, getType()); + acceptChildren(visitor, this.variableDeclarationFragments); } - acceptChild(visitor, getType()); - acceptChildren(visitor, this.variableDeclarationFragments); + ((AjASTVisitor)visitor).endVisit(this); } - ((AjASTVisitor)visitor).endVisit(this); } } \ No newline at end of file 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 e9f442370..9daecd31c 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 @@ -69,24 +69,27 @@ public class InterTypeMethodDeclaration extends MethodDeclaration { /* (omit javadoc for this method) * Method declared on ASTNode. */ - void accept0(ASTVisitor ajvis) { - boolean visitChildren = ajvis.visit(this); - if (visitChildren) { - // visit children in normal left to right reading order - acceptChild(ajvis, getJavadoc()); - if (this.ast.apiLevel == AST.JLS2_INTERNAL) { - acceptChild(ajvis, getReturnType()); - } else { - acceptChildren(ajvis, this.modifiers); - acceptChildren(ajvis, (NodeList)this.typeParameters()); - acceptChild(ajvis, getReturnType2()); + void accept0(ASTVisitor visitor) { + 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.JLS2_INTERNAL) { + acceptChild(ajvis, getReturnType()); + } else { + acceptChildren(ajvis, this.modifiers); + acceptChildren(ajvis, (NodeList)this.typeParameters()); + acceptChild(ajvis, getReturnType2()); + } + // n.b. visit return type even for constructors + acceptChild(ajvis, getName()); + acceptChildren(ajvis, this.parameters); + acceptChildren(ajvis, (NodeList)this.thrownExceptions()); + acceptChild(ajvis, getBody()); } - // n.b. visit return type even for constructors - acceptChild(ajvis, getName()); - acceptChildren(ajvis, this.parameters); - acceptChildren(ajvis, (NodeList)this.thrownExceptions()); - acceptChild(ajvis, getBody()); + ajvis.endVisit(this); } - ajvis.endVisit(this); } } \ No newline at end of file diff --git a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/NotPointcut.java b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/NotPointcut.java index f897d98b0..fc0408ea7 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/NotPointcut.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/NotPointcut.java @@ -81,13 +81,15 @@ public class NotPointcut extends PointcutDesignator { return ((AjASTMatcher)matcher).match(this, other); } void accept0(ASTVisitor visitor) { - boolean visitChildren = ((AjASTVisitor)visitor).visit(this); - if (visitChildren) { - // visit children in normal left to right reading order - acceptChild(visitor, getBody()); - // todo: accept the parameters here + if (visitor instanceof AjASTVisitor) { + boolean visitChildren = ((AjASTVisitor)visitor).visit(this); + if (visitChildren) { + // visit children in normal left to right reading order + acceptChild(visitor, getBody()); + // todo: accept the parameters here + } + ((AjASTVisitor)visitor).endVisit(this); } - ((AjASTVisitor)visitor).endVisit(this); } int treeSize() { return diff --git a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/OrPointcut.java b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/OrPointcut.java index f9ee05023..2fb1cee2c 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/OrPointcut.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/OrPointcut.java @@ -106,14 +106,16 @@ public class OrPointcut extends PointcutDesignator { return ((AjASTMatcher)matcher).match(this, other); } void accept0(ASTVisitor visitor) { - boolean visitChildren = ((AjASTVisitor)visitor).visit(this); - if (visitChildren) { - // visit children in normal left to right reading order - acceptChild(visitor, getLeft()); - acceptChild(visitor, getRight()); - // todo: accept the parameters here + if (visitor instanceof AjASTVisitor) { + boolean visitChildren = ((AjASTVisitor)visitor).visit(this); + if (visitChildren) { + // visit children in normal left to right reading order + acceptChild(visitor, getLeft()); + acceptChild(visitor, getRight()); + // todo: accept the parameters here + } + ((AjASTVisitor)visitor).endVisit(this); } - ((AjASTVisitor)visitor).endVisit(this); } int treeSize() { return diff --git a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/PerCflow.java b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/PerCflow.java index a8054b3d8..106a99c22 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/PerCflow.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/PerCflow.java @@ -91,13 +91,15 @@ public class PerCflow extends PointcutDesignator { return ((AjASTMatcher)matcher).match(this, other); } void accept0(ASTVisitor visitor) { - boolean visitChildren = ((AjASTVisitor)visitor).visit(this); - if (visitChildren) { - // visit children in normal left to right reading order - acceptChild(visitor, getBody()); - // todo: accept the parameters here + if (visitor instanceof AjASTVisitor) { + boolean visitChildren = ((AjASTVisitor)visitor).visit(this); + if (visitChildren) { + // visit children in normal left to right reading order + acceptChild(visitor, getBody()); + // todo: accept the parameters here + } + ((AjASTVisitor)visitor).endVisit(this); } - ((AjASTVisitor)visitor).endVisit(this); } int treeSize() { return diff --git a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/PerObject.java b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/PerObject.java index 957214753..a288611fa 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/PerObject.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/PerObject.java @@ -91,13 +91,15 @@ public class PerObject extends PointcutDesignator { return ((AjASTMatcher)matcher).match(this, other); } void accept0(ASTVisitor visitor) { - boolean visitChildren = ((AjASTVisitor)visitor).visit(this); - if (visitChildren) { - // visit children in normal left to right reading order - acceptChild(visitor, getBody()); - // todo: accept the parameters here + if (visitor instanceof AjASTVisitor) { + boolean visitChildren = ((AjASTVisitor)visitor).visit(this); + if (visitChildren) { + // visit children in normal left to right reading order + acceptChild(visitor, getBody()); + // todo: accept the parameters here + } + ((AjASTVisitor)visitor).endVisit(this); } - ((AjASTVisitor)visitor).endVisit(this); } int treeSize() { return diff --git a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/PerTypeWithin.java b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/PerTypeWithin.java index 5a83a9ea9..8b6d22c39 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/PerTypeWithin.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/PerTypeWithin.java @@ -55,12 +55,14 @@ public class PerTypeWithin extends PointcutDesignator { return ((AjASTMatcher)matcher).match(this, other); } void accept0(ASTVisitor visitor) { - boolean visitChildren = ((AjASTVisitor)visitor).visit(this); - if (visitChildren) { - // visit children in normal left to right reading order - // ajh02: remember to visit the type thingy here + if (visitor instanceof AjASTVisitor) { + boolean visitChildren = ((AjASTVisitor)visitor).visit(this); + if (visitChildren) { + // visit children in normal left to right reading order + // ajh02: remember to visit the type thingy here + } + ((AjASTVisitor)visitor).endVisit(this); } - ((AjASTVisitor)visitor).endVisit(this); } int treeSize() { return diff --git a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/ReferencePointcut.java b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/ReferencePointcut.java index 83de6fdc7..7ecd8b5c1 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/ReferencePointcut.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/ReferencePointcut.java @@ -91,13 +91,15 @@ public class ReferencePointcut extends PointcutDesignator { return ((AjASTMatcher)matcher).match(this, other); } void accept0(ASTVisitor visitor) { - boolean visitChildren = ((AjASTVisitor)visitor).visit(this); - if (visitChildren) { - // visit children in normal left to right reading order - acceptChild(visitor, getName()); - // todo: accept the parameters here + if (visitor instanceof AjASTVisitor) { + boolean visitChildren = ((AjASTVisitor)visitor).visit(this); + if (visitChildren) { + // visit children in normal left to right reading order + acceptChild(visitor, getName()); + // todo: accept the parameters here + } + ((AjASTVisitor)visitor).endVisit(this); } - ((AjASTVisitor)visitor).endVisit(this); } int treeSize() { return -- 2.39.5