RE: MethodTuple Constructor Arguments

"Shields, John (HQP)" <[email protected]>
Newsgroups gmane.comp.java.aspectwerkz.devel
Message-ID <1641BB0AA7287848817A63C3EE9677D526490E@hqp-ex-mb05.na.msds.rhi.com>
OK,
 
That makes sense. I took "original method" to mean the method before being
modified and "wrapper method" to mean the prefixed method. I hadn't yet gone
through the byte-code manipulation code to understand what you describe
below. I just had a wrong paradigm in my head.
 
Thanks for the explanation!
 
John
 

-----Original Message-----
From: Jonas Boner [mailto:[email protected]] 
Sent: Friday, April 30, 2004 10:06 PM
To: Shields, John (HQP); aspectwerkz-devel-81qHHgoATdGxIXFVlbCvtR2eb7JE58TQ@public.gmane.org
Subject: RE: [aspectwerkz-devel] MethodTuple Constructor Arguments


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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.