aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs/ThisJoinPointAndVerifier.java
blob: a3b609c40507db24c693392de2156fb90858e104 (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
/** Bugzilla Bug 34210  
   thisJoinPoint.getArgs() causes IncompatibleClassChangeError  */
public class ThisJoinPointAndVerifier {
	public void method() {
		System.out.println("Executed method");
	}
	public static void main(String args[]) {
		ThisJoinPointAndVerifier td = new ThisJoinPointAndVerifier();
		td.method();
	}
}

aspect Log1 {  
	pointcut logged_method() : 
		call(* ThisJoinPointAndVerifier.*(..));    
	after() : logged_method() {
		Object[] args = thisJoinPoint.getArgs(); 	
		System.out.println ("Log1a: leaving " + thisJoinPoint.getSignature());
	}    
	// comment this advice for scenario 2
	after() : logged_method() {
		//VM crash on scenario 1
		//Object[] args = thisJoinPoint.getArgs(); 
		System.out.println ("Log1b: leaving " + thisJoinPoint.getSignature());    
	}
}