@@ -0,0 +1,7 @@ | |||
import org.aspectj.lang.annotation.Aspect; | |||
import org.aspectj.lang.annotation.Pointcut; | |||
@Aspect | |||
public class AtTestTracing extends Tracing { | |||
} |
@@ -0,0 +1,2 @@ | |||
public aspect TestTracing extends Tracing { | |||
} |
@@ -0,0 +1,16 @@ | |||
public abstract aspect Tracing { | |||
before (Object obj) : execution(* *(..)) && this(obj) { | |||
System.out.println(thisJoinPoint); | |||
} | |||
// before (Object obj) : execution(* *(..)) && this(obj) { | |||
before () : execution(* *(..)) { | |||
System.out.println(thisJoinPointStaticPart); | |||
} | |||
// before (Object obj) : execution(* *(..)) && this(obj) { | |||
before () : execution(* *(..)) && this(Object) { | |||
System.out.println(thisEnclosingJoinPointStaticPart); | |||
} | |||
} |
@@ -0,0 +1,5 @@ | |||
public aspect SubAspect extends SuperAspect { | |||
// protected pointcut scope(); | |||
} |
@@ -0,0 +1,6 @@ | |||
import org.aspectj.lang.annotation.Aspect; | |||
@Aspect | |||
public class SubAtAspect extends SuperAspect { | |||
} |
@@ -0,0 +1,4 @@ | |||
public abstract aspect SuperAspect { | |||
protected abstract pointcut scope (); | |||
} |
@@ -71,6 +71,17 @@ public class Ajc151Tests extends org.aspectj.testing.XMLBasedAjcTestCase { | |||
assertFalse("printParameters method should have arguments",pe2.getParameterTypes().isEmpty()); | |||
} | |||
/* | |||
* @AspectJ bugs and enhancements | |||
*/ | |||
// public void testAtAspectInheritsAdviceWithTJPAndThis_pr125699 () { | |||
// runTest("inherit adivce with this() and thisJoinPoint"); | |||
// } | |||
public void testAtAspectInheritsAbstractPointcut_pr125810 () { | |||
runTest("warning when inherited pointcut not made concrete"); | |||
} | |||
/* | |||
* Load-time weaving bugs and enhancements | |||
*/ |
@@ -124,6 +124,19 @@ | |||
<compile files="AbstractMethods.aj, ConcreteMethods.aj"/> | |||
<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> | |||
<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"/> | |||
<message kind="error" line="1" text="inherited abstract pointcut SuperAspect.scope() is not made concrete in SubAspect"/> | |||
<message kind="error" line="3" text="inherited abstract pointcut SuperAspect.scope() is not made concrete in SubAtAspect"/> | |||
<message kind="error" line="4" text="inherited abstract pointcut SuperAspect.scope() is not made concrete in SubAtAspect"/> | |||
</compile> | |||
</ajc-test> | |||
<!-- New features down here... when they arent big enough to have their own test file --> |