Hi Benyi,
you are trying to weave the JRE classes, which is quite tricky cause you
have to weave the rt.jar at compie time and then run using the java
bootclasspath option to use the weaved rt.jar. If you want to trace calls to
lists only from inside your code, then try @Before("call(*
java.util.List.*(..))") .

Simone

2010/5/18 Benyi Wang <[email protected]>

> How can add an advice to the methods of java.util.List?
>
> I include the following into weaver options in aop.xml
>
> <aspectj>
> <aspects>
>  <aspect name="TestInterfaceAspect" />
> </aspects>
>
>  <weaver options="-verbose -showWeaveInfo">
> <include within="java.util.*"/>
>  </weaver>
> </aspectj>
>
> And
>
> @Aspect
> public class TestInterfaceAspect {
>
> @Before("execution(* java.util.List.*(..))")
> public void beforeListOperations(JoinPoint jp) {
>  System.out.println("Call " + jp.getSignature().toShortString());
> }
>  }
>
> but I always get a warning "advice defined in TestInterfaceAspect has not
> been applied [Xlint:adviceDidNotMatch]"?
>
> I'm using Eclipse 3.5 with AJDT.
>
> _______________________________________________
> aspectj-users mailing list
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to