Jesse,

>Can anyone explain either what I'm doing wrong, or why this doesn't work?
What do you mean? Does the pointcut not match? You need to annotate your 
target class(es):

public class Test {

        @myAnnotation
        public static int aspectTest(int i) {
                return i;
        }
 
        public static void main (String[] args) {
                aspectTest(args.length);
        }
}

Matthew Webster
AOSD Project
Java Technology Centre, MP146
IBM United Kingdom Limited
Hursley Park, Winchester,  SO21 2JN, England
Telephone: +44 196 2816139 (external) 246139 (internal)



Jesse Hepburn <[EMAIL PROTECTED]> 
Sent by: [EMAIL PROTECTED]
28/03/2007 22:49
Please respond to
[email protected]


To
[email protected]
cc

Subject
[aspectj-users] Help with calls to external packages






I'm trying to define a pointcut that intercepts calls from outside of the 
current package.  I've managed to get it to work as follows:

    pointcut myTest(int x):
        call(int *.aspectTest(int))
        && args(x);

    before(int x): myTest(x) {
        System.out.println("Some inspiring message");
    }

The problem is when I try to add an annotation to the mix:

    pointcut myTest(int x, myAnnotation a):
        call(int *.aspectTest(int))
        && args(x)
        && @annotation(a);

    before(int x, myAnnotation a): myTest(x, a) {
        System.out.println("this doesn't work");
    }

Can anyone explain either what I'm doing wrong, or why this doesn't work?






 
____________________________________________________________________________________
Bored stiff? Loosen up... 
Download and play hundreds of games for free on Yahoo! Games.
http://games.yahoo.com/games/front
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users







Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU





_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to