From e43fa758f360bd5cb29c653c3ff23bb581ef99e8 Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Sun, 29 Jan 2023 13:18:10 +0100 Subject: Add traverse methods for pointcut types Relates to #215. Signed-off-by: Alexander Kriegisch --- .../java/org/aspectj/weaver/patterns/AnnotationPointcut.java | 7 +++++++ .../org/aspectj/weaver/patterns/ArgsAnnotationPointcut.java | 8 ++++++++ .../main/java/org/aspectj/weaver/patterns/ArgsPointcut.java | 8 ++++++++ .../main/java/org/aspectj/weaver/patterns/CflowPointcut.java | 7 +++++++ .../main/java/org/aspectj/weaver/patterns/HandlerPointcut.java | 8 ++++++++ .../src/main/java/org/aspectj/weaver/patterns/IfPointcut.java | 10 ++++++++++ .../main/java/org/aspectj/weaver/patterns/KindedPointcut.java | 8 ++++++++ .../src/main/java/org/aspectj/weaver/patterns/PerCflow.java | 8 ++++++++ .../src/main/java/org/aspectj/weaver/patterns/PerObject.java | 8 ++++++++ .../java/org/aspectj/weaver/patterns/ReferencePointcut.java | 10 ++++++++++ .../weaver/patterns/ThisOrTargetAnnotationPointcut.java | 8 ++++++++ .../java/org/aspectj/weaver/patterns/ThisOrTargetPointcut.java | 8 ++++++++ .../org/aspectj/weaver/patterns/WithinAnnotationPointcut.java | 8 ++++++++ .../aspectj/weaver/patterns/WithinCodeAnnotationPointcut.java | 8 ++++++++ .../main/java/org/aspectj/weaver/patterns/WithinPointcut.java | 8 ++++++++ .../java/org/aspectj/weaver/patterns/WithincodePointcut.java | 8 ++++++++ 16 files changed, 130 insertions(+) diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/AnnotationPointcut.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/AnnotationPointcut.java index 6742e9091..cacbe9b4d 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/AnnotationPointcut.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/AnnotationPointcut.java @@ -333,4 +333,11 @@ public class AnnotationPointcut extends NameBindingPointcut { return visitor.visit(this, data); } + @Override + public Object traverse(PatternNodeVisitor visitor, Object data) { + Object ret = accept(visitor, data); + if (this.annotationTypePattern != null) + this.annotationTypePattern.traverse(visitor, ret); + return ret; + } } diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ArgsAnnotationPointcut.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ArgsAnnotationPointcut.java index 8494a97b1..06d712b23 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ArgsAnnotationPointcut.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ArgsAnnotationPointcut.java @@ -247,4 +247,12 @@ public class ArgsAnnotationPointcut extends NameBindingPointcut { public Object accept(PatternNodeVisitor visitor, Object data) { return visitor.visit(this, data); } + + @Override + public Object traverse(PatternNodeVisitor visitor, Object data) { + Object ret = accept(visitor, data); + if (this.arguments != null) + this.arguments.traverse(visitor, ret); + return ret; + } } diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ArgsPointcut.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ArgsPointcut.java index 8ff0e66f3..733445c7e 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ArgsPointcut.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ArgsPointcut.java @@ -285,4 +285,12 @@ public class ArgsPointcut extends NameBindingPointcut { public Object accept(PatternNodeVisitor visitor, Object data) { return visitor.visit(this, data); } + + @Override + public Object traverse(PatternNodeVisitor visitor, Object data) { + Object ret = accept(visitor, data); + if (this.arguments != null) + this.arguments.traverse(visitor, ret); + return ret; + } } diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/CflowPointcut.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/CflowPointcut.java index 0c746239f..4dbc87a82 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/CflowPointcut.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/CflowPointcut.java @@ -352,4 +352,11 @@ public class CflowPointcut extends Pointcut { return visitor.visit(this, data); } + @Override + public Object traverse(PatternNodeVisitor visitor, Object data) { + Object ret = accept(visitor, data); + if (this.entry != null) + this.entry.traverse(visitor, ret); + return ret; + } } diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/HandlerPointcut.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/HandlerPointcut.java index c2ab41811..e2d5e007b 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/HandlerPointcut.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/HandlerPointcut.java @@ -138,4 +138,12 @@ public class HandlerPointcut extends Pointcut { public Object accept(PatternNodeVisitor visitor, Object data) { return visitor.visit(this, data); } + + @Override + public Object traverse(PatternNodeVisitor visitor, Object data) { + Object ret = accept(visitor, data); + if (this.exceptionType != null) + this.exceptionType.traverse(visitor, ret); + return ret; + } } diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/IfPointcut.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/IfPointcut.java index e2a9b2192..f1b2d6e80 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/IfPointcut.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/IfPointcut.java @@ -489,6 +489,16 @@ public class IfPointcut extends Pointcut { return visitor.visit(this, data); } + @Override + public Object traverse(PatternNodeVisitor visitor, Object data) { + Object ret = accept(visitor, data); + if (this.partiallyConcretized != null) + this.partiallyConcretized.traverse(visitor, ret); + if (this.residueSource != null) + this.residueSource.traverse(visitor, ret); + return ret; + } + public static class IfFalsePointcut extends IfPointcut { public IfFalsePointcut() { diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/KindedPointcut.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/KindedPointcut.java index 278ff8f5b..098c2873f 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/KindedPointcut.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/KindedPointcut.java @@ -476,4 +476,12 @@ public class KindedPointcut extends Pointcut { public Object accept(PatternNodeVisitor visitor, Object data) { return visitor.visit(this, data); } + + @Override + public Object traverse(PatternNodeVisitor visitor, Object data) { + Object ret = accept(visitor, data); + if (this.signature != null) + this.signature.traverse(visitor, ret); + return ret; + } } diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/PerCflow.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/PerCflow.java index ac52cec74..c719b8b5c 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/PerCflow.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/PerCflow.java @@ -52,6 +52,14 @@ public class PerCflow extends PerClause { return visitor.visit(this, data); } + @Override + public Object traverse(PatternNodeVisitor visitor, Object data) { + Object ret = accept(visitor, data); + if (this.entry != null) + this.entry.traverse(visitor, ret); + return ret; + } + public int couldMatchKinds() { return Shadow.ALL_SHADOW_KINDS_BITS; } diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/PerObject.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/PerObject.java index 1a4600b73..4a1d4ffd0 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/PerObject.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/PerObject.java @@ -63,6 +63,14 @@ public class PerObject extends PerClause { return visitor.visit(this, data); } + @Override + public Object traverse(PatternNodeVisitor visitor, Object data) { + Object ret = accept(visitor, data); + if (this.entry != null) + this.entry.traverse(visitor, ret); + return ret; + } + public int couldMatchKinds() { return isThis ? thisKindSet : targetKindSet; } diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ReferencePointcut.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ReferencePointcut.java index 030131414..7c911c45c 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ReferencePointcut.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ReferencePointcut.java @@ -411,4 +411,14 @@ public class ReferencePointcut extends Pointcut { public Object accept(PatternNodeVisitor visitor, Object data) { return visitor.visit(this, data); } + + @Override + public Object traverse(PatternNodeVisitor visitor, Object data) { + Object ret = accept(visitor, data); + if (this.onTypeSymbolic != null) + this.onTypeSymbolic.traverse(visitor, ret); + if (this.arguments != null) + this.arguments.traverse(visitor, ret); + return ret; + } } diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ThisOrTargetAnnotationPointcut.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ThisOrTargetAnnotationPointcut.java index 83774bcb7..c78168b2b 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ThisOrTargetAnnotationPointcut.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ThisOrTargetAnnotationPointcut.java @@ -334,4 +334,12 @@ public class ThisOrTargetAnnotationPointcut extends NameBindingPointcut { public Object accept(PatternNodeVisitor visitor, Object data) { return visitor.visit(this, data); } + + @Override + public Object traverse(PatternNodeVisitor visitor, Object data) { + Object ret = accept(visitor, data); + if (this.annotationTypePattern != null) + this.annotationTypePattern.traverse(visitor, ret); + return ret; + } } diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ThisOrTargetPointcut.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ThisOrTargetPointcut.java index 7008ffd73..feb7442fc 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ThisOrTargetPointcut.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ThisOrTargetPointcut.java @@ -239,4 +239,12 @@ public class ThisOrTargetPointcut extends NameBindingPointcut { public Object accept(PatternNodeVisitor visitor, Object data) { return visitor.visit(this, data); } + + @Override + public Object traverse(PatternNodeVisitor visitor, Object data) { + Object ret = accept(visitor, data); + if (this.typePattern != null) + this.typePattern.traverse(visitor, ret); + return ret; + } } diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WithinAnnotationPointcut.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WithinAnnotationPointcut.java index ba568a3fd..de4dc55e6 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WithinAnnotationPointcut.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WithinAnnotationPointcut.java @@ -238,4 +238,12 @@ public class WithinAnnotationPointcut extends NameBindingPointcut { public Object accept(PatternNodeVisitor visitor, Object data) { return visitor.visit(this, data); } + + @Override + public Object traverse(PatternNodeVisitor visitor, Object data) { + Object ret = accept(visitor, data); + if (this.annotationTypePattern != null) + this.annotationTypePattern.traverse(visitor, ret); + return ret; + } } diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WithinCodeAnnotationPointcut.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WithinCodeAnnotationPointcut.java index 7c0458935..326a73eb2 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WithinCodeAnnotationPointcut.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WithinCodeAnnotationPointcut.java @@ -227,4 +227,12 @@ public class WithinCodeAnnotationPointcut extends NameBindingPointcut { public Object accept(PatternNodeVisitor visitor, Object data) { return visitor.visit(this, data); } + + @Override + public Object traverse(PatternNodeVisitor visitor, Object data) { + Object ret = accept(visitor, data); + if (this.annotationTypePattern != null) + this.annotationTypePattern.traverse(visitor, ret); + return ret; + } } diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WithinPointcut.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WithinPointcut.java index 4d4373e6d..644e19ebd 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WithinPointcut.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WithinPointcut.java @@ -146,4 +146,12 @@ public class WithinPointcut extends Pointcut { public Object accept(PatternNodeVisitor visitor, Object data) { return visitor.visit(this, data); } + + @Override + public Object traverse(PatternNodeVisitor visitor, Object data) { + Object ret = accept(visitor, data); + if (this.typePattern != null) + this.typePattern.traverse(visitor, ret); + return ret; + } } diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WithincodePointcut.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WithincodePointcut.java index edf77f4c6..d75808309 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WithincodePointcut.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WithincodePointcut.java @@ -138,4 +138,12 @@ public class WithincodePointcut extends Pointcut { public Object accept(PatternNodeVisitor visitor, Object data) { return visitor.visit(this, data); } + + @Override + public Object traverse(PatternNodeVisitor visitor, Object data) { + Object ret = accept(visitor, data); + if (this.signature != null) + this.signature.traverse(visitor, ret); + return ret; + } } -- cgit v1.2.3