summaryrefslogtreecommitdiffstats
path: root/tests/bugs150/pr113447/PR113447a.java
blob: d720c524442cced8d81e59f5a1c4158d6fc09b64 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

@Retention(RetentionPolicy.RUNTIME)
@interface Annotation{};

@Annotation
public class PR113447a {

	public static void main(String[] args) {
		PR113447a me = new PR113447a();
		me.method1();
		me.method3();
		me.method4(2);
	}
	
	public void method1(){}

	public void method3(){}
	
	public void method4(int i){}
	public void method5(int i){}
}

aspect Super {

	// second method doesn't exist
	pointcut pc1(Annotation a) : 
		(@this(a) && execution(void method1()))
		|| (@this(a) && execution(void method2()));

	before(Annotation a) : pc1(a) {}
	
	// second method does exist
	pointcut pc2(Annotation a) : 
		(@this(a) && execution(void method1()))
		|| (@this(a) && execution(void method3()));

	before(Annotation a) : pc2(a) {}
	
	// second method doesn't exist
	pointcut pc3(Annotation a) : 
		(@target(a) && call(void method1()))
		|| (@target(a) && call(void method2()));

	before(Annotation a) : pc3(a) {
	}
	
	// second method does exist
	pointcut pc4(Annotation a) : 
		(@target(a) && call(void method1()))
		|| (@target(a) && call(void method3()));

	before(Annotation a) : pc4(a) {
	}
	
	// @this equivalent of BaseTests.test024 which was affected by
	// the fix for the non annotation version
	pointcut p(Annotation a) : 
		@target(a) && (call(void method4(int)) 
				|| call(void method5(int)));

	before(Annotation a) : p(a) {}
	after(Annotation a): p(a) {}
}