From ff2377a7f3b3d2148d107a7c411cf8308d254136 Mon Sep 17 00:00:00 2001 From: aclement Date: Fri, 4 Aug 2006 10:29:04 +0000 Subject: [PATCH] test and fix for 152631: decp targetting aspect using cflow --- tests/bugs153/pr152631/EMA.java | 13 +++++++++++++ .../org/aspectj/systemtest/ajc153/Ajc153Tests.java | 1 + tests/src/org/aspectj/systemtest/ajc153/ajc153.xml | 4 ++++ .../src/org/aspectj/weaver/bcel/BcelTypeMunger.java | 4 ++-- 4 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 tests/bugs153/pr152631/EMA.java 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 @@ + + + + \ 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 } } -- 2.39.5