Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] A newbie writes

Title: RE: [aspectj-users] A newbie writes

Antti wrote:

Thanks for the response.
 
> Your pointcut catches the access to instance and static variables of type string
> (not access to local variables (access to which is not possible to catch) nor to arguments).

That's not a problem - it's an instance variable I'm trying to watch.

> If this is what you intended, there's still a gotcha: the get(* *.*) catches the
> accesses that are in types visible to the aspect (either in the same package or imported).

The aspect and the class are in the same package.

> If you want your aspect to catch accesses in classes that are in different packages,
> try something like pointcut fieldtest(String s) : target(s) && get(String com.mycompany..*.*);

I tried specifying the package in this way and still it still isn't noticing when my code accesses the field.  If I take out the "&& get()" the pointcut does trigger so it can definitely see the String field I'm trying to monitor.

Can you think of any other reason why this pointcut might not be working?


Robbie


__________________________________________________
This electronic message contains information which may be privileged and confidential.  The information is intended to be for the use of the individual(s) or entity named above.  If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited.  If you have received this electronic message in error, please notify us by telephone on 0131 476 6000 and delete the material from your computer.


Back to the top