+++ /dev/null
-import org.aspectj.lang.ProceedingJoinPoint;
-import org.aspectj.lang.annotation.Around;
-import org.aspectj.lang.annotation.Aspect;
-import org.aspectj.lang.annotation.DeclarePrecedence;
-
-@Aspect
-@DeclarePrecedence("MarkerAAspect, MarkerBAspect")
-public class MarkerAAspect {
- @Around("@annotation(MarkerA) && execution(* *(..))")
- public Object intercept(ProceedingJoinPoint thisJoinPoint) throws Throwable {
- System.out.println(">> Outer intercept");
- Object result = null;
- for (int i = 0; i < Application.proceedTimesOuter; i++) {
- System.out.println(" >> Outer proceed");
- result = thisJoinPoint.proceed();
- System.out.println(" << Outer proceed");
- }
- System.out.println("<< Outer intercept");
- return result;
- }
-}
+++ /dev/null
-public aspect MarkerANativeAspect {
- declare precedence : MarkerANativeAspect, MarkerBNativeAspect;
- public static int proceedTimes = 1;
-
- Object around() : @annotation(MarkerA) && execution(* *(..)) {
- System.out.println(">> Outer intercept");
- Object result = null;
- for (int i = 0; i < Application.proceedTimesOuter; i++) {
- System.out.println(" >> Outer proceed");
- result = proceed();
- System.out.println(" << Outer proceed");
- }
- System.out.println("<< Outer intercept");
- return result;
- }
-}
+++ /dev/null
-import org.aspectj.lang.ProceedingJoinPoint;
-import org.aspectj.lang.annotation.Around;
-import org.aspectj.lang.annotation.Aspect;
-
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-@Aspect
-public class MarkerBAspect {
- @Around("@annotation(MarkerB) && execution(* *(..))")
- public Object intercept(ProceedingJoinPoint thisJoinPoint) throws Throwable {
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- try {
- for (int i = 0; i < Application.proceedTimesInner; i++) {
- System.out.println(" >> Inner proceed");
- thisJoinPoint.proceed();
- System.out.println(" << Inner proceed");
- }
- }
- catch (Throwable throwable) {
- throwable.printStackTrace(System.out);
- }
- }
- };
-
- System.out.println(" >> Inner intercept");
- if (Application.useThreadPool)
- Application.executorService.submit(runnable);
- else
- new Thread(runnable).start();
- System.out.println(" << Inner intercept");
- return null;
- }
-}
+++ /dev/null
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-public aspect MarkerBNativeAspect {
- Object around() : @annotation(MarkerB) && execution(* *(..)) {
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- try {
- for (int i = 0; i < Application.proceedTimesInner; i++) {
- System.out.println(" >> Inner proceed");
- proceed();
- System.out.println(" << Inner proceed");
- }
- }
- catch (Throwable throwable) {
- throwable.printStackTrace(System.out);
- }
- }
- };
-
- System.out.println(" >> Inner intercept");
- if (Application.useThreadPool)
- Application.executorService.submit(runnable);
- else
- new Thread(runnable).start();
- System.out.println(" << Inner intercept");
- return null;
- }
-}
--- /dev/null
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.DeclarePrecedence;
+
+@Aspect
+@DeclarePrecedence("MarkerAAspect, MarkerBAspect")
+public class MarkerAAspect {
+ @Around("@annotation(MarkerA) && execution(* *(..))")
+ public Object intercept(ProceedingJoinPoint thisJoinPoint) throws Throwable {
+ System.out.println(">> Outer intercept");
+ Object result = null;
+ for (int i = 0; i < Application.proceedTimesOuter; i++) {
+ System.out.println(" >> Outer proceed");
+ result = thisJoinPoint.proceed();
+ System.out.println(" << Outer proceed");
+ }
+ System.out.println("<< Outer intercept");
+ return result;
+ }
+}
--- /dev/null
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+@Aspect
+public class MarkerBAspect {
+ @Around("@annotation(MarkerB) && execution(* *(..))")
+ public Object intercept(ProceedingJoinPoint thisJoinPoint) throws Throwable {
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ try {
+ for (int i = 0; i < Application.proceedTimesInner; i++) {
+ System.out.println(" >> Inner proceed");
+ thisJoinPoint.proceed();
+ System.out.println(" << Inner proceed");
+ }
+ }
+ catch (Throwable throwable) {
+ throwable.printStackTrace(System.out);
+ }
+ }
+ };
+
+ System.out.println(" >> Inner intercept");
+ if (Application.useThreadPool)
+ Application.executorService.submit(runnable);
+ else
+ new Thread(runnable).start();
+ System.out.println(" << Inner intercept");
+ return null;
+ }
+}
--- /dev/null
+public aspect MarkerAAspect {
+ declare precedence : MarkerAAspect, MarkerBAspect;
+
+ Object around() : @annotation(MarkerA) && execution(* *(..)) {
+ System.out.println(">> Outer intercept");
+ Object result = null;
+ for (int i = 0; i < Application.proceedTimesOuter; i++) {
+ System.out.println(" >> Outer proceed");
+ result = proceed();
+ System.out.println(" << Outer proceed");
+ }
+ System.out.println("<< Outer intercept");
+ return result;
+ }
+}
--- /dev/null
+public aspect MarkerBAspect {
+ Object around() : @annotation(MarkerB) && execution(* *(..)) {
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ try {
+ for (int i = 0; i < Application.proceedTimesInner; i++) {
+ System.out.println(" >> Inner proceed");
+ proceed();
+ System.out.println(" << Inner proceed");
+ }
+ }
+ catch (Throwable throwable) {
+ throwable.printStackTrace(System.out);
+ }
+ }
+ };
+
+ System.out.println(" >> Inner intercept");
+ if (Application.useThreadPool)
+ Application.executorService.submit(runnable);
+ else
+ new Thread(runnable).start();
+ System.out.println(" << Inner intercept");
+ return null;
+ }
+}
</ajc-test>
<ajc-test dir="bugs198/github_128" title="asynchronous proceed for nested around-advice (@AspectJ)">
- <compile files="Application.java MarkerA.java MarkerAAspect.aj MarkerB.java MarkerBAspect.aj" options="-1.8" />
+ <compile files="Application.java MarkerA.java MarkerB.java annotation_syntax/MarkerAAspect.aj annotation_syntax/MarkerBAspect.aj" options="-1.8" />
<run class="Application" options="1,1">
<stdout ordered="no">
<line text=">> Outer intercept"/>
</ajc-test>
<ajc-test dir="bugs198/github_128" title="asynchronous proceed for nested around-advice (@AspectJ, thread pool)">
- <compile files="Application.java MarkerA.java MarkerAAspect.aj MarkerB.java MarkerBAspect.aj" options="-1.8" />
+ <compile files="Application.java MarkerA.java MarkerB.java annotation_syntax/MarkerAAspect.aj annotation_syntax/MarkerBAspect.aj" options="-1.8" />
<run class="Application" options="1,1,true">
<stdout ordered="no">
<line text=">> Outer intercept"/>
</ajc-test>
<ajc-test dir="bugs198/github_128" title="asynchronous proceed for nested around-advice (native)">
- <compile files="Application.java MarkerA.java MarkerANativeAspect.aj MarkerB.java MarkerBNativeAspect.aj" options="-1.8" />
+ <compile files="Application.java MarkerA.java MarkerB.java native_syntax/MarkerAAspect.aj native_syntax/MarkerBAspect.aj" options="-1.8" />
<run class="Application" options="1,1">
<stdout ordered="no">
<line text=">> Outer intercept"/>
</ajc-test>
<ajc-test dir="bugs198/github_128" title="asynchronous proceed for nested around-advice (native, thread pool)">
- <compile files="Application.java MarkerA.java MarkerANativeAspect.aj MarkerB.java MarkerBNativeAspect.aj" options="-1.8" />
+ <compile files="Application.java MarkerA.java MarkerB.java native_syntax/MarkerAAspect.aj native_syntax/MarkerBAspect.aj" options="-1.8" />
<run class="Application" options="1,1,true">
<stdout ordered="no">
<line text=">> Outer intercept"/>