@@ -1,5 +1,4 @@ | |||
import org.aspectj.lang.annotation.Aspect; | |||
import org.aspectj.lang.annotation.Pointcut; | |||
@Aspect | |||
public class AtTestTracing extends Tracing { |
@@ -0,0 +1,3 @@ | |||
public abstract aspect SubAbstractTracing extends Tracing { | |||
} |
@@ -0,0 +1,6 @@ | |||
import org.aspectj.lang.annotation.Aspect; | |||
@Aspect | |||
public class SubAtAj extends SubAbstractTracing { | |||
} |
@@ -39,6 +39,8 @@ public class Ajc151Tests extends org.aspectj.testing.XMLBasedAjcTestCase { | |||
//public void testExposingWithintype_enh123423() { runTest("exposing withintype");} | |||
//public void testMissingImport_pr127299() { runTest("missing import gives funny message");} | |||
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 testMixingNumbersOfTypeParameters_pr125080() { | |||
runTest("mixing numbers of type parameters"); |
@@ -133,10 +133,22 @@ | |||
<run class="HelloWorld" ltw="aop-tracing.xml"/> | |||
</ajc-test> | |||
<ajc-test dir="bugs151/pr125699" title="inherit adivce with this() and thisJoinPoint"> | |||
<compile files="Tracing.aj, TestTracing.aj, AtTestTracing.java" options="-1.5"/> | |||
<ajc-test dir="bugs151/pr125699" title="inherit advice with this() and thisJoinPoint"> | |||
<compile files="Tracing.aj, TestTracing.aj, AtTestTracing.java" options="-1.5"> | |||
<message kind="warning" line="13" text="advice defined in Tracing has not been applied [Xlint:adviceDidNotMatch]"/> | |||
<message kind="warning" line="8" text="advice defined in Tracing has not been applied [Xlint:adviceDidNotMatch]"/> | |||
<message kind="warning" line="3" text="advice defined in Tracing has not been applied [Xlint:adviceDidNotMatch]"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="bugs151/pr125699" title="inherit advice with this() and thisJoinPoint - 2"> | |||
<compile files="Tracing.aj, SubAbstractTracing.aj, SubAtAj.java" options="-1.5"> | |||
<message kind="warning" line="13" text="advice defined in Tracing has not been applied [Xlint:adviceDidNotMatch]"/> | |||
<message kind="warning" line="8" text="advice defined in Tracing has not been applied [Xlint:adviceDidNotMatch]"/> | |||
<message kind="warning" line="3" text="advice defined in Tracing has not been applied [Xlint:adviceDidNotMatch]"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="bugs151/pr125810" title="warning when inherited pointcut not made concrete"> | |||
<compile files="SuperAspect.aj, SubAspect.aj, SubAtAspect.java" options="-1.5"> | |||
<message kind="error" line="3" text="inherited abstract pointcut SuperAspect.scope() is not made concrete in SubAspect"/> |
@@ -502,9 +502,12 @@ public class BcelWeaver implements IWeaver { | |||
if (advice.getSignature() != null) { | |||
final int numFormals; | |||
final String names[]; | |||
//ATAJ for @AJ aspect, the formal have to be checked according to the argument number | |||
// since xxxJoinPoint presence or not have side effects | |||
if (advice.getConcreteAspect().isAnnotationStyleAspect()) { | |||
// If the advice is being concretized in a @AJ aspect *and* the advice was declared in | |||
// an @AJ aspect (it could have been inherited from a code style aspect) then | |||
// evaluate the alternative set of formals. pr125699 | |||
if (advice.getConcreteAspect().isAnnotationStyleAspect() | |||
&& advice.getDeclaringAspect()!=null | |||
&& advice.getDeclaringAspect().resolve(world).isAnnotationStyleAspect()) { | |||
numFormals = advice.getBaseParameterCount(); | |||
int numArgs = advice.getSignature().getParameterTypes().length; | |||
if (numFormals > 0) { |