PDA

View Full Version : Method with ref params


CheekyTinker
11-17-2005, 02:17 PM
Is there are known issue with using AOP to intercept method calls where the method has ref params.

I've found the call gets intercepted but I get an exception when I call proceed or try to access any of the IMethodInvoke properties etc. I've only tested a method with a single param which is a ref. My workaround has been to refactor my code to remove the ref param, returning the object instead, but I'd like to know if this is a genuine restriction, something I'm doing wrong or a bug.

Thanks

Aleks Seovic
11-30-2005, 01:44 AM
Honestly, I haven't really thought abot that and have never tried it.

My guess is that it's a bone fide bug, because you need to declare parameter as ref both in the calling code and within target method signature, and I know for a fact that I'm not doing that when delegating call to a target object. I'm also not sure how to pass ref parameters using reflection, definitely need to investigate more...

I'll try to take care of this when I get back to AOP, which might be a while. My understanding is that this is not a pressing issue for you right now, am I right?

Thanks for pointing this out,

Aleks

Mark Pollack
11-30-2005, 03:29 AM
Added it to JIRA-SPRNET-252 (http://opensource2.atlassian.com/projects/spring/browse/SPRNET-252) so we forget.

Mark

CheekyTinker
12-07-2005, 01:48 PM
Yes, not a problem, I've refactored to remove the ref parameters, decided they weren't required. I'll watch out the JIRA issue being resolved. Overall the AOP stuff is excellent by the way. Thanks

Bruno Baia
05-04-2007, 06:26 AM
Hi,

Ref/Out parameters are now supported in Spring.Aop
Donwload the latest nightly build (http://www.springframework.net/downloads/nightly/) and give it a try.

-Bruno