aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs199/github_128/native_syntax/MarkerBAspect.aj
blob: 52e95d1eb6f1deb11ba8a3ce25ef103443bac8e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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;
  }
}