summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2006-08-04 10:29:04 +0000
committeraclement <aclement>2006-08-04 10:29:04 +0000
commitff2377a7f3b3d2148d107a7c411cf8308d254136 (patch)
treebb030755572d63ca361c114a5900ba04fafd854b
parent1e9ca71a253b099a3b3ed8ec17994d8be1f24995 (diff)
downloadaspectj-ff2377a7f3b3d2148d107a7c411cf8308d254136.tar.gz
aspectj-ff2377a7f3b3d2148d107a7c411cf8308d254136.zip
test and fix for 152631: decp targetting aspect using cflow
-rw-r--r--tests/bugs153/pr152631/EMA.java13
-rw-r--r--tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java1
-rw-r--r--tests/src/org/aspectj/systemtest/ajc153/ajc153.xml4
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java4
4 files changed, 20 insertions, 2 deletions
diff --git a/tests/bugs153/pr152631/EMA.java b/tests/bugs153/pr152631/EMA.java
new file mode 100644
index 000000000..a9de7fa2d
--- /dev/null
+++ b/tests/bugs153/pr152631/EMA.java
@@ -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();
+}
diff --git a/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java b/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java
index 954e223f7..bca2c1443 100644
--- a/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java
@@ -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");}
diff --git a/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml b/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml
index 7a8c50131..d0e994614 100644
--- a/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml
+++ b/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml
@@ -254,4 +254,8 @@
</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
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java b/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
index a802d87c5..b1c998ed8 100644
--- a/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
+++ b/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
@@ -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
}
}