Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] about set pcd capabilities

Thank you Eric.
 
Ulises J. M.
 
 
-----Original Message-----
From: eric.bodden@xxxxxxxxxxxxxx
To: aspectj-users@xxxxxxxxxxx
Sent: Mon, 27 Nov 2006 7:17 PM
Subject: RE: [aspectj-users] about set pcd capabilities

Oh, I just remembered...

What I said is not entirely true. There is a solution without using
reflection if you think 4D ;-)

The point is that if at time t_i there is a previous value for a field
this means that the field has been set before, at time t_{i-1}. So what
you can do is, every time the field is set, you store its value
somewhere on the heap, so that on the subsequent set-joinpoint it's
available from there.

I blogged an example ages ago here:
http://www.bodden.de/n/index.php?option=com_content&task=view&id=35&Item id=31 There I also describe a 3rd solution using "tracematches". Eric > -----Original Message----- > From: Eric Bodden > Sent: Monday, November 27, 2006 5:35 PM > To: 'aspectj-users@xxxxxxxxxxx'
> Subject: RE: [aspectj-users] about set pcd capabilities
>
> No, you have to use reflection.
>
>
> Eric
>
>
> > -----Original Message-----
> > From: aspectj-users-bounces@xxxxxxxxxxx [mailto:aspectj-users- > > bounces@xxxxxxxxxxx] On Behalf Of ujuarez71@xxxxxxxxxxxx > > Sent: Monday, November 27, 2006 3:18 PM > > To: aspectj-users@xxxxxxxxxxx > > Subject: [aspectj-users] about set pcd capabilities > > > > Hi. > > > > Is there a way to know the previos value of a field when I apply a > set > > pcd ?? > > > > Suppose I have the next piece of code: > > > > 1. double d; > > 2. void m() { > > 3. d = 5.5; > > // a lot of code here > > 40. d = Math.random(); > > 41. System.out.println(d); > > 42. } > > > > I can use 'set(double d)' to know the new value will be assigned to > 'd' > > field. Can I know the OLD value of 'd' at line 40 ?? > > > > Is it possible to apply get/set pcd and advising field 'd' at line 1 > ?? > > > > > > Best regards. > > > > Uli. > > > > ________________________________ > > > > Check Out the new free AIM(R) Mail > > > <http://pr.atwola.com/promoclk/100122638x1081283466x1074645346/aol?redi > > r=http%3A%2F%2Fwww%2Eaim%2Ecom%2Ffun%2Fmail%2F> -- 2 GB of storage > and > > industry-leading spam and email virus protection. _______________________________________________ aspectj-users mailing list aspectj-users@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/aspectj-users

Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection.

Back to the top