Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] AW: Pointcut on a constructor withacustom@Annotation

> I'd expect the @target form in the advice to match the construction of C in
> this example, but it appears that the rule is based on whether the
> annotation is on the most derived class and not whether the type has an
> annotation on one of its runtime types.

Annotations are inherited if you put @Inherited on them.
Making the annotation inherited ensures @target matches:

C:\aspectj1.5.1a>java AnnotatedCtor
I new exec with @target AnnotatedBase@750159
I new exec with @target C@18a7efd
I new exec with @target C@18a7efd

Also Ramnivas raised a bug a while ago on some problems with '+' when
annotations are in the mix:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=128664

- Andy.


Back to the top