Browse Source

tests and (slightly reworked) fix for 125699 from Helen. @AJ bug with inherited advice from code style aspects.

tags/POST_MEMORY_CHANGES
aclement 18 years ago
parent
commit
15930e7f92

+ 0
- 1
tests/bugs151/pr125699/AtTestTracing.java View File

@@ -1,5 +1,4 @@
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;

@Aspect
public class AtTestTracing extends Tracing {

+ 3
- 0
tests/bugs151/pr125699/SubAbstractTracing.aj View File

@@ -0,0 +1,3 @@
public abstract aspect SubAbstractTracing extends Tracing {
}

+ 6
- 0
tests/bugs151/pr125699/SubAtAj.java View File

@@ -0,0 +1,6 @@
import org.aspectj.lang.annotation.Aspect;

@Aspect
public class SubAtAj extends SubAbstractTracing {

}

+ 2
- 0
tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java View File

@@ -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");

+ 15
- 3
tests/src/org/aspectj/systemtest/ajc151/ajc151.xml View File

@@ -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"/>

+ 6
- 3
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java View File

@@ -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) {

Loading…
Cancel
Save