--- /dev/null
+package test;
+
+public class ClassThatAlreadyIncludesRequiredMethods {
+ public void something() {
+ }
+}
\ No newline at end of file
--- /dev/null
+package test;
+
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.DeclareParents;
+
+@Aspect
+public class
+DeclareParentsForNonMarkerInterfaceToAClassThatAlreadyIncludeRequiredMethods {
+ @DeclareParents("test.ClassThatAlreadyIncludesRequiredMethods")
+ public NonMarkerInterface nmi;
+}
\ No newline at end of file
--- /dev/null
+package test;
+
+public interface NonMarkerInterface {
+ public void something();
+}
\ No newline at end of file
--- /dev/null
+package a.b;
+
+public class A {
+ public Object m1() {
+ return m2();
+ }
+
+ public Object m2() {
+ return m3();
+ }
+
+ public Object m3() {return "x";}
+}
--- /dev/null
+package c.d;
+
+public abstract aspect AbstractDurationMethod {
+ public abstract pointcut methods();
+
+ Object around(): methods() {
+ Object o = proceed();
+ System.out.println("Proceeded at joinpoint "+thisJoinPoint);
+ return o;
+ }
+}
--- /dev/null
+package c.d;;
+
+public aspect DurationMethod extends AbstractDurationMethod {
+ public pointcut methods(): within(a.b.*) && call (public * a..*(..));
+}
--- /dev/null
+import a.b.*;
+
+public class Runner {
+ public static void main(String []argv) {
+ new A().m1();
+ }
+}
--- /dev/null
+package a.b;
+
+public class A {
+ public Object m1() {
+ return m2();
+ }
+
+ public Object m2() {
+ return m3();
+ }
+
+ public Object m3() {return "x";}
+}
--- /dev/null
+package c.d;
+
+public abstract aspect AbstractDurationMethod {
+ public abstract pointcut methods();
+
+ Object around(): methods() {
+ Object o = proceed();
+ System.out.println("Proceeded at joinpoint "+thisJoinPoint);
+ return o;
+ }
+}
--- /dev/null
+package c.d;
+
+import org.aspectj.lang.annotation.*;
+
+@Aspect
+public class AtDurationMethod extends AbstractDurationMethod {
+ @Pointcut("within(a.b.*) && call(public * a..*(..))")
+ public void methods() {}
+}
--- /dev/null
+import a.b.*;
+
+public class Runner {
+ public static void main(String []argv) {
+ new A().m1();
+ }
+}
--- /dev/null
+package a.b;
+
+public class A {
+ public Object m1() {
+ return m2();
+ }
+
+ public Object m2() {
+ return m3();
+ }
+
+ public Object m3() {return "x";}
+}
--- /dev/null
+package c.d;
+
+public abstract aspect AbstractDurationMethod {
+ public abstract pointcut methods();
+
+ Object around(): methods() {
+ Object o = proceed();
+ System.out.println("Proceeded at joinpoint "+thisJoinPoint);
+ return o;
+ }
+}
--- /dev/null
+import a.b.*;
+
+public class Runner {
+ public static void main(String []argv) {
+ new A().m1();
+ }
+}
--- /dev/null
+<aspectj>
+ <aspects>
+ <aspect name="c.d.AbstractDurationMethod"/>
+ <concrete-aspect name="c.d.AtDurationMethod"
+ extends="c.d.AbstractDurationMethod">
+ <pointcut name="methods"
+ expression="within(a.b.*) AND call (public * a..*(..))" />
+ </concrete-aspect>
+ </aspects>
+ <weaver/>
+</aspectj>