Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] @Aspect("perthis(this(Person))")

This looks like a plain old bug. Please could you raise a bug report
and we'll get a fix published for you.

Thanks, Adrian.

On 30/08/05, Oli B. <boehm@xxxxxxxxxx> wrote:
> Hi,
> 
> when I try to translate an existing aspect into the annotation-based
> style (according the developers notebook) my example doesn't work any more:
> 
>    @Aspect("perthis(this(verwaltung.Person))")
>    public class ArbeitszeitAspekt {
>        // body: see at the end
>    }
> 
> Here the compiler says "can't do instanceof matching on patterns with
> wildcards". When I try
> 
>    @Aspect("perthis(this(Person))")
>    ...
> 
> I get no compiler message but it does not work (even if the aspect is
> also in the same package "verwaltung") - I have not the expected output
> (dead pointcut).
> 
>     @Aspect
>     ...
> 
> This works (but only as singleton and not an aspect for each Person
> object), so the rest of my aspect seems to be ok. Is this a bug (which I
> should report) or do I use the wrong syntax for the perthis statement?
> 
> kind regards
> Oliver
> 
> 
> 
> 
> 
> ==== here some additional info ====>
> 
> Mmy original aspect where I want to stop the time of the
> Person.arbeite() execution:
> 
> public aspect ArbeitszeitAspektOld perthis(this(verwaltung.Person)) {
>     long start;
>     long end;
>     //
>     void around(Person x) :
>             execution(public void Person.arbeite()) && this(x) {
>         start = System.currentTimeMillis();
>         proceed(x);
>         end = System.currentTimeMillis();
>         System.out.println("*** Arbeitszeit " + x + ": "
>                 + new Date(start)
>                 + " - " + new Date(end));
>     }
> }
> 
> And here the body of the aspect (just to complete the example)
> 
> public class ArbeitszeitAspekt {
>     long start;
>     long end;
>     //
>     @Around("execution(public void verwaltung.Person.arbeite()) && this(x)")
>     public void watchWorkingHours(ProceedingJoinPoint thisJoinPoint,
>             Person x) {
>         start = System.currentTimeMillis();
>         thisJoinPoint.proceed(new Object[] {x});
>         end = System.currentTimeMillis();
>         System.out.println("*** ARBEITSZEIT " + x + ": "
>                 + new Date(start) + " - "
>                 + new Date(end));
>     }
> }
> 
> --
> Oliver Böhm
> http://www.javatux.de
> 
> _______________________________________________
> aspectj-dev mailing list
> aspectj-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-dev
> 


-- 
-- Adrian
adrian.colyer@xxxxxxxxx


Back to the top