summaryrefslogtreecommitdiffstats
path: root/tests/bugs/CatchSig.java
blob: 81d960416636e5f0f96844afc2f0f390b5f9fe0d (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
/*
 * Bugzilla Bug 37739  
   Unexpected Xlint:unresolvableMember warning with withincode 
 */
public class CatchSig {
	CatchSig(Class type) {}

	CatchSig() {
		this(String.class);
	}
	
	public static void main(String[] args) {
		new CatchSig();
		new B().test();
		new B().test2();
		B.findClass();
	}
}

class B extends CatchSig {
	public B() {
		super(findClass());
	}
	
	static Class findClass() {
		return B.class;
	}

	public void test() {
	}

	public void test2() {
		test();
	}
}

aspect C {
	void around() :
		(call (void B.test()) &&
		 withincode (void B.test2())) {
		System.out.println("test from test2");
		proceed();
	}
	
	before(): call(Class B.findClass()) {
		System.out.println("from: " + thisEnclosingJoinPointStaticPart);
	}
	before(): call(Class B.findClass()) && withincode(B.new()) {
		System.out.println("from B.new()");
	}
}