]> source.dussan.org Git - aspectj.git/commitdiff
fix and tests for
authorjhugunin <jhugunin>
Fri, 25 Apr 2003 18:11:33 +0000 (18:11 +0000)
committerjhugunin <jhugunin>
Fri, 25 Apr 2003 18:11:33 +0000 (18:11 +0000)
Bugzilla Bug 36803
   BCException thrown by AspectJ 1.1rc1

tests/ajcTests.xml
tests/bugs/CflowConcrete.java [new file with mode: 0644]
tests/jimTests.xml
weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java
weaver/src/org/aspectj/weaver/patterns/Pointcut.java
weaver/src/org/aspectj/weaver/patterns/WithinPointcut.java
weaver/src/org/aspectj/weaver/patterns/WithincodePointcut.java

index 4f869e5e4a4d0c52cca03e02878864b29838ade1..ebaedd66c401197d92a93f71f36f3fb5060630bb 100644 (file)
         </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 (file)
index 0000000..16eebeb
--- /dev/null
@@ -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); }
+} 
index 61e8777a6fa888fc665b66eb2061fed4a9c41c41..6de1c507c9825f540d8e19264947815c7896e8bf 100644 (file)
@@ -1,7 +1,7 @@
 <!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd">
 <suite>    
 
-    
+
 
     <!--
   
index 6fd2042578ced5f584b2cbc337614dd215139e47..8be3671f02abe4f773ddd1189d5905ee9f813609 100644 (file)
@@ -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() {
index 3cd0c9cf6a2a821d5fe71a672ac6c6684484488c..91fe52860fbab248bb9e0cd3b006b8b429eae133 100644 (file)
@@ -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);
                }
 
 
index f2f8addc60697cb8a9361f1d69ede949fc68bb95..9775f705e1dc978daa083ada2cf3b562bfeb8261 100644 (file)
@@ -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);
        }
 }
index d673c8ecb353a12f0268f2e146a5fa82965565dd..71dba0d302b980ce5365d391010287118983d068 100644 (file)
@@ -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);
        }
 }