diff options
-rw-r--r-- | tests/bugs151/pr125699/AtTestTracing.java | 1 | ||||
-rw-r--r-- | tests/bugs151/pr125699/SubAbstractTracing.aj | 3 | ||||
-rw-r--r-- | tests/bugs151/pr125699/SubAtAj.java | 6 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java | 2 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc151/ajc151.xml | 18 | ||||
-rw-r--r-- | weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java | 9 |
6 files changed, 32 insertions, 7 deletions
diff --git a/tests/bugs151/pr125699/AtTestTracing.java b/tests/bugs151/pr125699/AtTestTracing.java index 32d380f8b..faa429cc2 100644 --- a/tests/bugs151/pr125699/AtTestTracing.java +++ b/tests/bugs151/pr125699/AtTestTracing.java @@ -1,5 +1,4 @@ import org.aspectj.lang.annotation.Aspect; -import org.aspectj.lang.annotation.Pointcut; @Aspect public class AtTestTracing extends Tracing { diff --git a/tests/bugs151/pr125699/SubAbstractTracing.aj b/tests/bugs151/pr125699/SubAbstractTracing.aj new file mode 100644 index 000000000..526ca3b78 --- /dev/null +++ b/tests/bugs151/pr125699/SubAbstractTracing.aj @@ -0,0 +1,3 @@ +public abstract aspect SubAbstractTracing extends Tracing { + +} diff --git a/tests/bugs151/pr125699/SubAtAj.java b/tests/bugs151/pr125699/SubAtAj.java new file mode 100644 index 000000000..aad7c2462 --- /dev/null +++ b/tests/bugs151/pr125699/SubAtAj.java @@ -0,0 +1,6 @@ +import org.aspectj.lang.annotation.Aspect; + +@Aspect +public class SubAtAj extends SubAbstractTracing { + +} diff --git a/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java b/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java index b15102fa2..7a64444b9 100644 --- a/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java @@ -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"); diff --git a/tests/src/org/aspectj/systemtest/ajc151/ajc151.xml b/tests/src/org/aspectj/systemtest/ajc151/ajc151.xml index 140d66e22..de0488dbd 100644 --- a/tests/src/org/aspectj/systemtest/ajc151/ajc151.xml +++ b/tests/src/org/aspectj/systemtest/ajc151/ajc151.xml @@ -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"/> diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java b/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java index db4caee5a..118e7bfee 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java @@ -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) { |