Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Pointcut fails to match when arguments combinedwith ".."


Glenn,

Unfortunately pointcuts not matching is one of the hardest things to diagnose. Could you post you whole aspect (or as much of it as you are willing to disclose) and a full example of a join point you are trying to match. Also could you give some examples of your environment e.g. AJDT, Ant or load-time weaving.

Cheers

Matthew Webster
AOSD Project
Java Technology Centre, MP146
IBM Hursley Park, Winchester,  SO21 2JN, England
Telephone: +44 196 2816139 (external) 246139 (internal)
Email: Matthew Webster/UK/IBM @ IBMGB, matthew_webster@xxxxxxxxxx
http://w3.hursley.ibm.com/~websterm/



Glenn Farrow <glenn@xxxxxxxxxxxxxxx>
Sent by: aspectj-users-bounces@xxxxxxxxxxx

19/09/2006 15:43

Please respond to
glenn@xxxxxxxxxxxxxxx; Please respond to
aspectj-users@xxxxxxxxxxx

To
Ron Bodkin <rbodkin@xxxxxxxxxxxxxx>
cc
aspectj-users@xxxxxxxxxxx
Subject
Re: [aspectj-users] Pointcut fails to match when arguments        combinedwith ".."





No, tried that too previously.  Same result.



Ron Bodkin wrote:
> I think you want args(p, ..) to match any number of arguments as long as the
> first one is a Level; args(p) will match exactly one argument of type Level.
>
> -----Original Message-----
> From: aspectj-users-bounces@xxxxxxxxxxx
> [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Glenn Farrow
> Sent: Tuesday, September 19, 2006 6:33 AM
> To: aspectj-users@xxxxxxxxxxx
> Subject: [aspectj-users] Pointcut fails to match when arguments combinedwith
> ".."
>
> Observer the following pointcut and advice which is supposed to match
> all calls to Logger.log(..).  Logger.log always takes a Level as the
> first parameter.  However the advice never gets applied.
>
>     pointcut logCall(Level p) : target(Logger) && args(p) &&
> !within(LoggingAspect) && call(void log(..));
>     before(Level p) : logCall(p) {
>         Errors.add(p);
>     }
>
> If I revise the pointcut and advice as follows it does get applied.
> AspectJ seems to be getting confused when trying to use arguments and
> specifying additional optional arguments using wildcards.
>
> pointcut logCall() : target(Logger) && !within(LoggingAspect) &&
> call(void(log(..));
> before() : logCall() {
>     dummy();
> }
>
> What's the scoop?  I've also tried the following and it doesn't match
> either:
>
>     pointcut logCall(Level p) : target(Logger) && args(p) &&
> !within(LoggingAspect) && call(void log(Level, ..));
>     before(Level p) : logCall(p) {
>         Errors.add(p);
>     }
>
>
>
>
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>  
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top