diff options
-rw-r--r-- | loadtime/src/org/aspectj/weaver/loadtime/ConcreteAspectCodeGen.java | 9 | ||||
-rw-r--r-- | tests/bugs151/pr128744/Hello.java | 17 | ||||
-rw-r--r-- | tests/bugs151/pr128744/World.java | 9 | ||||
-rw-r--r-- | tests/bugs151/pr128744/aop.xml | 11 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java | 1 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc151/ajc151.xml | 10 |
6 files changed, 56 insertions, 1 deletions
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 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<aspectj> + <aspects> + <aspect name="World" /> + <concrete-aspect name="World1" extends="World"> + <pointcut name="monitoredOperation" expression="execution(* sayHello())" /> + </concrete-aspect> + </aspects> + + <weaver options="-verbose -showWeaveInfo" /> +</aspectj>
\ 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 @@ <run class="Test" ltw="aop.xml"/> </ajc-test> + <ajc-test dir="bugs151/pr128744" title="broken ltw"> + <compile files="Hello.java World.java" options="-1.5" /> + <run class="Hello" ltw="aop.xml"> + <stdout> + <line text="Hello"/> + <line text="World"/> + </stdout> + </run> + </ajc-test> + <ajc-test dir="bugs151/pr125480" title="aop.xml aspect inherits abstract method that has concrete implementation in parent"> <compile files="HelloWorld.java"/> <compile files="AbstractMethods.aj, ConcreteMethods.aj"/> |