RE: MethodTuple Constructor Arguments
"Jonas Boner" <[email protected]>
| Newsgroups | gmane.comp.java.aspectwerkz.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi John. The 'original' method is actually the prefixed method (the one that has the original code). Since what we do is that we are adding a prefix to the 'real original' method (which has the original code). We then create a 'wrapper' method with the same name as the 'original' method. In this wrapper method we then add the call to the advice etc. and in the end of this chain we invoke the 'prefixed' method (which is the original one). Do I make sense here? I assume that the user really wants the original method (e.g the one with the original code) when he invokes the 'getMethod' method. Not the wrapper one that only has code for invoking the advice chain. Is this not what you want? Do I misunderstand you? What do you want to do? /Jonas -- Jonas Bonér Senior Software Engineer Java Runtime Products Group BEA Systems Cell: +46707616256 _____ From: aspectwerkz-devel-admin-81qHHgoATdGxIXFVlbCvtR2eb7JE58TQ@public.gmane.org [mailto:aspectwerkz-devel-admin-81qHHgoATdGxIXFVlbCvtR2eb7JE58TQ@public.gmane.org] On Behalf Of Shields, John (HQP) Sent: Friday, April 30, 2004 8:29 PM To: 'aspectwerkz-devel-81qHHgoATdGxIXFVlbCvtR2eb7JE58TQ@public.gmane.org' Subject: [aspectwerkz-devel] MethodTuple Constructor Arguments Hello, I figured this one is more suited to the developer list than the user list, but please let me know if you'd rather the user list or JIRA. I noticed that in my aspects using the MethodSignature.getMethod() method returns the prefixed AW method, not the original method like I'd expect. If I change it to use ((MethodSignatureImpl)signature).getMethodTuple().getWrapperMethod(), then I get the original method. I noticed that in AspectRegistry, there is a comment that reads "// create a method tuple with 'wrapped method' and 'prefixed method'" just before creating the MethodTuple. In the MethodTuple constructor, I noticed that the second parameter is named "originalMethod". The AspectRegistry therefore passes a parameter named "prefixedMethod" to the constructor that calls it "originalMethod". I think that this is backwards. I think there is some confusion regarding the variable names. The comment refers to a "wrapped method" but the variable is named "wrapperMethod"... However, when I make the "fix" in my version, I end up with a StackOverflowError because the original method gets called recursively. I started to track down the error but thought I'd post this first since it may be something simple for you guys to fix. I also noticed a comment about Cflow being broken by JIT and thought that maybe this could be related... Regards, John