]> source.dussan.org Git - aspectj.git/commitdiff
test and fix for 152631: decp targetting aspect using cflow
authoraclement <aclement>
Fri, 4 Aug 2006 10:29:04 +0000 (10:29 +0000)
committeraclement <aclement>
Fri, 4 Aug 2006 10:29:04 +0000 (10:29 +0000)
tests/bugs153/pr152631/EMA.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java
tests/src/org/aspectj/systemtest/ajc153/ajc153.xml
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java

diff --git a/tests/bugs153/pr152631/EMA.java b/tests/bugs153/pr152631/EMA.java
new file mode 100644 (file)
index 0000000..a9de7fa
--- /dev/null
@@ -0,0 +1,13 @@
+
+public aspect EMA {
+    before() : cflow(execution(* *(..))) {}
+}
+
+aspect Goo {
+  declare parents: EMA extends C;
+  public void EMA.m() {}
+}
+
+abstract class C {
+  abstract void m();
+}
index 954e223f78fb2ff99b544d6db47a536bfbb82f8c..bca2c144348d686638ceab4a9e11b94536b17c0e 100644 (file)
@@ -26,6 +26,7 @@ public class Ajc153Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
   // public void testArgnamesAndJavac_pr148381() { runTest("argNames and javac");}
   // public void testCFlowXMLAspectLTW_pr149096() { runTest("cflow xml concrete aspect"); }
   // public void testAmbiguousBinding_pr121805() { runTest("ambiguous binding");}
+  public void testDecpAndCflowadderMungerClash_pr152631() { runTest("decp and cflowadder munger clash");}
   public void testGenericInheritanceDecp_pr150095() { runTest("generics, inheritance and decp");}
   public void testIllegalStateException_pr148737() { runTest("illegalstateexception for non generic type");}
   public void testAtajInheritance_pr149305_1()     { runTest("ataj inheritance - 1");}
index 7a8c501312ff7cffff6f4d37b2057ac6876f85d4..d0e9946140f35d67ea8231c0dcd997f1c2becc37 100644 (file)
       </compile>
     </ajc-test>
     
+    <ajc-test dir="bugs153/pr152631" title="decp and cflowadder munger clash">
+      <compile files="EMA.java" options="-1.5"/>
+    </ajc-test>
+    
 </suite>
\ No newline at end of file
index a802d87c595b64e875c055018033cb445aa18609..b1c998ed8529beea64cf8ff702f73900d944c514 100644 (file)
@@ -247,7 +247,7 @@ public class BcelTypeMunger extends ConcreteTypeMunger {
                         boolean satisfiedByITD = false;
                         for (Iterator ii = newParentTarget.getType().getInterTypeMungersIncludingSupers().iterator(); ii.hasNext(); ) {
                             ConcreteTypeMunger m = (ConcreteTypeMunger)ii.next();
-                            if (m.getMunger().getKind() == ResolvedTypeMunger.Method) {
+                            if (m.getMunger()!=null && m.getMunger().getKind() == ResolvedTypeMunger.Method) {
                                 ResolvedMember sig = m.getSignature();
                                 if (!Modifier.isAbstract(sig.getModifiers())) {
                                        
@@ -265,7 +265,7 @@ public class BcelTypeMunger extends ConcreteTypeMunger {
                                         satisfiedByITD = true;
                                     }
                                 }
-                            } else if (m.getMunger().getKind() == ResolvedTypeMunger.MethodDelegate) {
+                            } else if (m.getMunger()!=null && m.getMunger().getKind() == ResolvedTypeMunger.MethodDelegate) {
                                 satisfiedByITD = true;//AV - that should be enough, no need to check more
                             }
                         }