Community
Participate
Working Groups
When a point cut refers to a type, and that type cannot be found: pointcut p(): execution(* *(..)) && (within(@Foo *) || within(@Bar *)); it may not be the end of the world (e.g. if Foo is missing above, the pointcut may still be OK and match). When this occurs we produce a cantFindType message. Feels like it should be possible to express that this shouldn't be a fatal problem using something like SuppressAjWarnings on the pointcut
For 1.8.3 I've actually implemented a high level feature to ease this problem. Namely @RequiredTypes: @RequiredTypes("some.fully.qualified.Type") aspect Foo { This annotation applies to an aspect and takes a list of strings. Each string is a fully qualified type name. If the type cannot be found on the class path the aspect is 'turned off' and it will have no effect on the system. This is useful in environments like spring where the spring-aspects library includes a number of aspects covering different domains but all packaged together. If a user is not exploiting a particular technology they don't want the aspect related to that tech firing but because all the aspects are in one jar with the aop.xml file, they'll all be turned on. This means even though the aspect will do nothing (pointcuts within it won't match because the developer isn't doing anything that might match) the developer must include some dependencies on the aspect library in order to avoid nasty 'cant find type' messages when the aspects attempt to get applied. @RequiredTypes means if those dependencies are not around, the aspects are turned off (== no more can't find type).
What was/is originally proposed in this bugs is a more granular control, which I still think we may need, so leaving this bug open.