Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Interface Constructors

> ... The only way I can think to do this in AspectJ-1.1 is ugly:
> 
>      execution(new(..)) &&
> if(!thisJoinPointStaticPart.getSignature().getDeclaringType().isInterface())
> 
> You could imagine an AspectJ compiler completely optimizing this kind of 
> test away; however, the current ajc-1.1.1 will require a couple of cheap 
> methods calls here.

This solution also doesn't work if you want the static shadow of a join point (e.g., declare warning). But it is a general purpose approach that's available today for dynamic contexts (advice, etc.).


Back to the top