Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] binding parts of the formals

I found it is cumbersome to write a pointcut. Say a method has 5 
arguments. Then I need to define all 5 arguments as the formals of my 
pointcut if I'm only interested in one of them. Is this just because of my 
limited understanding? 
Example: class A{ public void Method(int f, int s, int t, int forth, int 
fifth) {...}};
My after advice only tries to check if forth is bigger than fifth. Can I 
write:
after(int forth, int fifth):args(forth,fifth)&&call(public A.Method(//rest 
of the signature))?

My knowledge tells me this won't work since the "forth" in advice doesn't 
correspond to the "forth" in method formals. Or does it? 

Reason for asking this is that to be able to bind to a subcontext allows 
me to write more flexible virtual pointcuts.

Thanks. 

Charles Zhang 		
Graduate Student, Middleware Systems Research Group
ECE, U. of Toronto (http://www.eecg.utoronto.ca/~czhang)
" Yawn!!"  




Back to the top