diff options
-rw-r--r-- | tests/ajcTests.xml | 6 | ||||
-rw-r--r-- | tests/bugs/CflowConcrete.java | 19 | ||||
-rw-r--r-- | tests/jimTests.xml | 2 | ||||
-rw-r--r-- | weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java | 1 | ||||
-rw-r--r-- | weaver/src/org/aspectj/weaver/patterns/Pointcut.java | 6 | ||||
-rw-r--r-- | weaver/src/org/aspectj/weaver/patterns/WithinPointcut.java | 2 | ||||
-rw-r--r-- | weaver/src/org/aspectj/weaver/patterns/WithincodePointcut.java | 2 |
7 files changed, 32 insertions, 6 deletions
diff --git a/tests/ajcTests.xml b/tests/ajcTests.xml index 4f869e5e4..ebaedd66c 100644 --- a/tests/ajcTests.xml +++ b/tests/ajcTests.xml @@ -5872,4 +5872,10 @@ </compile> </ajc-test> + <ajc-test dir="bugs" pr="36803" + title="cflow concretization causing assertion failure"> + <compile files="CflowConcrete.java"/> + <run class="CflowConcrete"/> + </ajc-test> + </suite> diff --git a/tests/bugs/CflowConcrete.java b/tests/bugs/CflowConcrete.java new file mode 100644 index 000000000..16eebeba8 --- /dev/null +++ b/tests/bugs/CflowConcrete.java @@ -0,0 +1,19 @@ +// for Bug#: 31423 +import org.aspectj.testing.Tester; + + +public class CflowConcrete { + public static void main(String[] args) { + } +} + +aspect TestAjc { + pointcut notMySelf(): !within(TestAjc) && !cflow(within(TestAjc)); + + pointcut eachCall(): notMySelf() && call(* *.*(..)); + pointcut eachExecution(): notMySelf() && execution(* *.*(..)) ; + + before(): eachCall() { System.out.println(thisJoinPoint); } + + before(): eachExecution() { System.out.println(thisJoinPoint); } +} diff --git a/tests/jimTests.xml b/tests/jimTests.xml index 61e8777a6..6de1c507c 100644 --- a/tests/jimTests.xml +++ b/tests/jimTests.xml @@ -1,7 +1,7 @@ <!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"> <suite> - + <!-- diff --git a/weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java b/weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java index 6fd204257..8be3671f0 100644 --- a/weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java +++ b/weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java @@ -103,7 +103,6 @@ public class KindedPointcut extends Pointcut { public Pointcut concretize1(ResolvedTypeX inAspect, IntMap bindings) { return new KindedPointcut(kind, signature); - //return this; //??? no pointers out of here so we're okay } public Shadow.Kind getKind() { diff --git a/weaver/src/org/aspectj/weaver/patterns/Pointcut.java b/weaver/src/org/aspectj/weaver/patterns/Pointcut.java index 3cd0c9cf6..91fe52860 100644 --- a/weaver/src/org/aspectj/weaver/patterns/Pointcut.java +++ b/weaver/src/org/aspectj/weaver/patterns/Pointcut.java @@ -137,7 +137,9 @@ public abstract class Pointcut extends PatternNode { * @param bindings a Map from formal index in the current lexical context * -> formal index in the concrete advice that will run * - * ??? does this return a new pointcut + * This must always return a new Pointcut object (even if the concretized + * Pointcut is identical to the resolved one). That behavior is + * assumed in many places. * XXX fix implementors to handle state */ protected abstract Pointcut concretize1(ResolvedTypeX inAspect, IntMap bindings); @@ -212,7 +214,7 @@ public abstract class Pointcut extends PatternNode { public Pointcut concretize1( ResolvedTypeX inAspect, IntMap bindings) { - return this; + return makeMatchesNothing(state); } diff --git a/weaver/src/org/aspectj/weaver/patterns/WithinPointcut.java b/weaver/src/org/aspectj/weaver/patterns/WithinPointcut.java index f2f8addc6..9775f705e 100644 --- a/weaver/src/org/aspectj/weaver/patterns/WithinPointcut.java +++ b/weaver/src/org/aspectj/weaver/patterns/WithinPointcut.java @@ -93,6 +93,6 @@ public class WithinPointcut extends Pointcut { public Pointcut concretize1(ResolvedTypeX inAspect, IntMap bindings) { - return this; //??? no pointers out of here so we're okay + return new WithinPointcut(typePattern); } } diff --git a/weaver/src/org/aspectj/weaver/patterns/WithincodePointcut.java b/weaver/src/org/aspectj/weaver/patterns/WithincodePointcut.java index d673c8ecb..71dba0d30 100644 --- a/weaver/src/org/aspectj/weaver/patterns/WithincodePointcut.java +++ b/weaver/src/org/aspectj/weaver/patterns/WithincodePointcut.java @@ -84,6 +84,6 @@ public class WithincodePointcut extends Pointcut { public Pointcut concretize1(ResolvedTypeX inAspect, IntMap bindings) { - return this; //??? no pointers out of here so we're okay + return new WithincodePointcut(signature); } } |