From: aclement Date: Tue, 21 Feb 2006 15:52:36 +0000 (+0000) Subject: test and fix for 128744 (or at least the LTW problem Sian hit whilst debugging it...) X-Git-Tag: POST_MEMORY_CHANGES~55 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7a2087ef985e8af73045bac1e7e0195bb87c7f40;p=aspectj.git test and fix for 128744 (or at least the LTW problem Sian hit whilst debugging it...) --- diff --git a/loadtime/src/org/aspectj/weaver/loadtime/ConcreteAspectCodeGen.java b/loadtime/src/org/aspectj/weaver/loadtime/ConcreteAspectCodeGen.java index ff1ea65cf..bb6af4aac 100644 --- a/loadtime/src/org/aspectj/weaver/loadtime/ConcreteAspectCodeGen.java +++ b/loadtime/src/org/aspectj/weaver/loadtime/ConcreteAspectCodeGen.java @@ -164,7 +164,14 @@ public class ConcreteAspectCodeGen { ResolvedMember method = (ResolvedMember) methods.next(); if (method.isAbstract()) { if ("()V".equals(method.getSignature())) { - elligibleAbstractions.add(method.getName()); + String n = method.getName(); + if (n.startsWith("ajc$pointcut")) { // Allow for the abstract pointcut being from a code style aspect compiled with -1.5 (see test for 128744) + n = n.substring(14); + n = n.substring(0,n.indexOf("$")); + elligibleAbstractions.add(n); + } else { + elligibleAbstractions.add(method.getName()); + } } else { reportError("Abstract method '" + method.getName() + "' cannot be concretized as a pointcut (illegal signature, must have no arguments, must return void): " + stringify()); return false; diff --git a/tests/bugs151/pr128744/Hello.java b/tests/bugs151/pr128744/Hello.java new file mode 100644 index 000000000..268239ebc --- /dev/null +++ b/tests/bugs151/pr128744/Hello.java @@ -0,0 +1,17 @@ + +public class Hello { + + /** + * @param args + */ + public static void main(String[] args) { + // TODO Auto-generated method stub + //System.out.println("main"); + sayHello(); + } + + public static void sayHello(){ + System.out.println("Hello"); + } + +} diff --git a/tests/bugs151/pr128744/World.java b/tests/bugs151/pr128744/World.java new file mode 100644 index 000000000..542f1a665 --- /dev/null +++ b/tests/bugs151/pr128744/World.java @@ -0,0 +1,9 @@ + + +public abstract aspect World { + public abstract pointcut monitoredOperation(); + + after() : monitoredOperation() { + System.out.println("World"); + } +} diff --git a/tests/bugs151/pr128744/aop.xml b/tests/bugs151/pr128744/aop.xml new file mode 100644 index 000000000..f93ebc417 --- /dev/null +++ b/tests/bugs151/pr128744/aop.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java b/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java index 11af51054..0832c4a47 100644 --- a/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java @@ -42,6 +42,7 @@ public class Ajc151Tests extends org.aspectj.testing.XMLBasedAjcTestCase { public void testUnusedInterfaceMessage_pr120527() { runTest("incorrect unused interface message");} public void testAtAspectInheritsAdviceWithTJPAndThis_pr125699 () { runTest("inherit advice with this() and thisJoinPoint"); } public void testAtAspectInheritsAdviceWithTJPAndThis_pr125699_2 () {runTest("inherit advice with this() and thisJoinPoint - 2"); } + public void testBrokenLTW_pr128744() { runTest("broken ltw"); } public void testMixingNumbersOfTypeParameters_pr125080() { runTest("mixing numbers of type parameters"); diff --git a/tests/src/org/aspectj/systemtest/ajc151/ajc151.xml b/tests/src/org/aspectj/systemtest/ajc151/ajc151.xml index dfbcc1b73..c76ccbac7 100644 --- a/tests/src/org/aspectj/systemtest/ajc151/ajc151.xml +++ b/tests/src/org/aspectj/systemtest/ajc151/ajc151.xml @@ -132,6 +132,16 @@ + + + + + + + + + +