[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[List Home]
|
Re: [aspectj-users] Pointcut not matching when using Generics
|
- From: Andy Clement <andrew.clement@xxxxxxxxx>
- Date: Thu, 20 May 2010 16:16:40 -0700
- Delivered-to: aspectj-users@eclipse.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=r02dQOfZ1WiBk1W3e1FZWXK0HDw+2xOq79JPNG1xlrc=; b=HxS17braqKJbM9Pw9MeD3w8yDTr3qkrt+2ahqezEvKMACjdssaegYIZQI7lSGQWBrV 5LkY0jYN9nCIXnVaNHh7up43EUxJ7mLym6GakqZAWbJBtQhNoGCuoQT3JO3YlfSJRzdd tlYc+DdnbFZNllhvXF8MQ/SpSx21fJG7Mlqdo=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=qYjDHZHaFVrlmiE4xFWSY28roT1C7r8nQ1qmD5+ujn2LDe3dmJlLY03KgBYmXEdvDd m7ZS5f81jVb9XeV0Cr0KaP2i/eNzCaUANATqFEFAoc6rK0dCl207LWoaOooaJXtd9mmO CP9Uh697+A3pYGolEHqKKm+GuoPNrkUhJ5dlo=
Your two programs just compiled fine for me:
N:\aspectj168>ajc -showWeaveInfo -1.5 Main.java Captures.java
Join point 'method-execution(java.util.List Main.doS())' in Type
'Main' (Main.java:5) advised by around advice from 'Captures'
(Captures.java:12)
What version of AspectJ are you on? (I am using 1.6.8). I presume
you are compiling on the command line (as you are using showWeaveInfo)
- how does your compile command differ from mine?
Andy
On 20 May 2010 15:27, Bhaskar Maddala <maddalab@xxxxxxxxx> wrote:
> Hello,
>
> I am having trouble with generic type signature and matching
> joinpoints for an execution pointcut
>
> I have the following
>
> import java.util.Collections;
> import java.util.List;
>
> public class Main {
> public List<String> doS() {
> return Collections.emptyList();
> }
>
> public static void main(String[] args) {
> new Main().doS();
> }
> }
>
> And an aspect
>
> import java.util.Collections;
>
> import org.aspectj.lang.ProceedingJoinPoint;
> import org.aspectj.lang.annotation.Around;
> import org.aspectj.lang.annotation.Aspect;
> import org.aspectj.lang.annotation.Pointcut;
>
> @Aspect
> public class Captures {
>
> @Around("execution(public java.util.List<java.lang.String> Main.doS())")
> public Object quickTest(ProceedingJoinPoint pjp) throws Throwable {
> pjp.proceed();
> System.out.println("Se");
> return Collections.emptyList();
> }
> }
>
> I have showweaveinfo set to true and when building do not see any
> information (tried running and did not see the output on the screen).
> I replace the execution pointcut on quickTest to
>
> @Around("execution(public java.util.List Main.doS())")
>
> and see the output when running, also the weave info.
>
> Looking through the documentation
>
> http://www.eclipse.org/aspectj/doc/released/adk15notebook/generics-inAspectJ5.html
>
> I do not see what I am doing wrong
>
> Thanks
> Bhaskar
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>