aboutsummaryrefslogtreecommitdiffstats
path: root/tests/new/EachJVMOnSelf.java
blob: 01fc8bba682530374697a91fbd4d2690d7d724c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import org.aspectj.testing.Tester;

public class EachJVMOnSelf {
    public static void main(String[] args) {
	new C();

	Tester.checkEqual(A.aspectOf().advisedNewClass, "C");
    }
}

aspect A issingleton() {
    String advisedNewClass = null;

    after () returning (): this(*) && execution(new(..)) && !this(A) {
		advisedNewClass = thisJoinPoint.getSourceLocation().getWithinType().getName();
    }
}

class C {
}