@@ -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; |
@@ -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"); | |||
} | |||
} |
@@ -0,0 +1,9 @@ | |||
public abstract aspect World { | |||
public abstract pointcut monitoredOperation(); | |||
after() : monitoredOperation() { | |||
System.out.println("World"); | |||
} | |||
} |
@@ -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> |
@@ -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"); |
@@ -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"/> |