aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs150/pr115237.aj
blob: 87241765d5a8f93372d4eb0860721fc5da784b9c (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
28
29
30
31
32
33
34
35
36
37
public class pr115237 {
	public static void main(String[] args) {
		C c = new C();
		c.go();
		A a = A.aspectOf(c);
		// ok, illegal - aspectOf only on concrete aspects?
		// AA aa = AA.aspectOf(c);

		// hmm - n/a for parameterized types?
		B b = B.aspectOf(c);
		//BB capt  = BB.aspectOf(c); // unexpected compile error here
		//System.out.println("A " + a + " capt " + capt);
	}
	static class C {
		void go() {}		
	}
	
	abstract static aspect AA pertarget(pc()) {
		abstract pointcut pc();
		before() : pc() {
			System.out.println("go()");
		}
	}
	static aspect A extends AA {
		pointcut pc() : call(void C.go());
	}
	
	abstract static aspect BB<T> pertarget(pc()) {
		abstract pointcut pc();
		before() : pc() {
			System.out.println("go()");
		}
	}
	static aspect B extends BB<C> {
		pointcut pc() : call(void C.go());
	}
}