Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] @args pointcut advice not working

Parameter annotation value extraction is not possible right now.  From
the online doc:

> Parameter annotation matching is being added in AspectJ1.6. Initially only matching is supported but binding will be implemented at some point.

So it is not a bug, it is an enhancement request :)

cheers,
Andy.

2008/5/6 Paulo Zenida <paulo.zenida@xxxxxxxx>:
> Hi all,
>
>  I have tried the following snippet of code:
>
>  public class T {
>   public void f(@Length(min = 0, max = 1) String s1) {
>   }
>
>   public static void main(String[] args) {
>     T t = new T();
>     f.f("123");
>   }
>  }
>
>  public aspect A {
>   private pointcut lengthParam1(final Object parameter, final Length length)
> :
>     execution(* *(@Length (*), ..)) &&
>     args(parameter, ..) &&
>     @args(length, ..);
>
>   before(final Object parameter, final Length length) :
>     lengthParam1(parameter, length) {
>     enforce(thisJoinPoint, thisEnclosingJoinPointStaticPart, parameter,
>     length, 1);
>   }
>
>   private void enforce(org.aspectj.lang.JoinPoint joinPoint,
>     org.aspectj.lang.JoinPoint.StaticPart enclosingJoinPoint,
>     Object parameter, Length length, int parameterNumber) {
>     System.out.println("Do something...");
>   }
>  }
>
>  But no advice is executed. Is this a bug or am I missing something?
>
>  Kind regards,
>
>  Paulo Zenida
>
>  _______________________________________________
>  aspectj-users mailing list
>  aspectj-users@xxxxxxxxxxx
>  https://dev.eclipse.org/mailman/listinfo/aspectj-users
>


Back to the top