Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Annotations to pieces of advice

Hi Eric,

If the annotation is lost (and yet it has runtime retention specified)
then that is a bug.  We have an open bug for annotations against
declare constructs (
https://bugs.eclipse.org/bugs/show_bug.cgi?id=234932 ) and in there it
says 'check other constructs too...'.  Yes, the annotation you see is
added by ajc.

Andy

2009/5/19 Eric Bodden <eric.bodden@xxxxxxxxxxxxxx>:
> Hi all.
>
> I am having a problem with the following piece of advice:
>
>        @name("foo")
>        after(Object o): execution(* foo()) && target(o) {
>                System.err.println("foo");
>        }
>
> As you can see, it is annotated, and I am looking for a way to
> "discover" the annotation "foo" for this piece of advice at runtime.
> However, when I inspect the annotations for the advice method that ajc
> produces for this piece of advice, then instead I only get the
> following annotation:
>
> @org.aspectj.lang.annotation.After(argNames=o, value=(execution(*
> foo()) && target(o)))
>
> I assume that ajc adds this annotation as an artifact of the weaving
> process, which is nice, but it also seems as ajc does not preserver
> the additional annotation that I added to the advice. Is this a bug?
> Or how else am I supposed to find out at runtime whether or not an
> advice carries an annotation?
>
> Cheers,
> Eric
>
> --
> Eric Bodden
> Sable Research Group, McGill University
> Montréal, Québec, Canada
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>


Back to the top