1
/*******************************************************************************
2
* Copyright (c) 2005 Contributors.
4
* This program and the accompanying materials are made available
5
* under the terms of the Eclipse Public License v1.0
6
* which accompanies this distribution and is available at
7
* http://eclipse.org/legal/epl-v10.html
10
* Alexandre Vasseur initial implementation
11
*******************************************************************************/
14
import org.aspectj.lang.annotation.Aspect;
15
import org.aspectj.lang.annotation.Around;
16
import org.aspectj.lang.annotation.Before;
17
import org.aspectj.lang.annotation.SuppressAjWarnings;
18
import org.aspectj.lang.ProceedingJoinPoint;
21
* @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a>
23
public class AroundInlineMungerTestAspects2 {
25
public static abstract aspect OpenBase {
26
protected void superMethod() {}
29
public static abstract aspect OpenSubBase extends OpenBase {}
31
// aspect will be prepared for inlining
32
public static aspect Open extends OpenSubBase {
34
public static int aroundCount = 0;
35
public static int beforeCount = 0;
41
Object around() : execution(* ataspectj.AroundInlineMungerTest2.target()) {
45
new Inner().priv();//fails to be wrapped so this advice will not be inlined but previous call were still prepared
49
// this advice to test around advice body call/get/set advising
51
before() : (call(* ataspectj.AroundInlineMungerTestAspects2.Open.priv(..))
52
|| get(int ataspectj.AroundInlineMungerTestAspects2.Open.i)
53
|| set(int ataspectj.AroundInlineMungerTestAspects2.Open.i)
54
|| get(int ataspectj.AroundInlineMungerTestAspects2.Open.I)
55
|| set(int ataspectj.AroundInlineMungerTestAspects2.Open.I)
56
)&& this(ataspectj.AroundInlineMungerTestAspects2.Open) {
61
Object around() : execution(* ataspectj.AroundInlineMungerTest2.target()) {
64
new Inner().priv();//fails to be wrapped so next calls won't be prepared but previous was
70
Object around() : execution(* ataspectj.AroundInlineMungerTest2.target()) {
72
// all those field access will be wrapped
80
// -- some private member for which access will be wrapped so that around advice can be inlined
82
private void priv(int i, long j, int k) {
86
private static class Inner {
88
private void priv() {};