Community
Participate
Working Groups
I'll use this bug to capture info on the implementation...
What a pig of a feature - now checked in... First change is in ResolvedMember. - I've added the ability for it to manage annotations. - Also, I've added a flag that can be specified on resolvedmembers which indicates its' annotations can be found elsewhere. Why did I need the latter option? This is because for ITDs we create fake resolvedmembers that look like the original declaration (e.g. "int A.m()") but have no annotations. Managing the annotations on these fake resolvedmembers as well as on the real members in the original aspect would be expensive, so setting this flag can indicate that for a particular member you should look elsewhere for the annotations - the caller has to do the hunting. This is used to support field ITDs. The flag is not serialized (so the binary format isn't affected), it is set correctly when the NewFieldTypeMunger is constructed from the attributes in the class file. Info that will help you understand the rest of the changes: ITDs are represented by 'bunches' of methods, some put in the target type, some put in the aspect. Annotations are stored against just *one* of these methods, and that being one of those placed in the aspect - if any of the other methods are encountered we have to go back to the aspect to ask this special method what the annotations are. BcelClassWeaver has had the following changes. - Cache introduced from resolvedmembers (from effective signature attributes) to arrays of annotation types. The cache shouldn't get very large as it is only populated for ITD constructs, not all resolvedmembers. - weaving of dec@ into methods and fields has been extended for ITDs, I've put in quite a few guards and optimizations where I can. - I got rid of field-execution join points - I modified the match logic to discover the annotations for ITD'd methods - this uses the cache I introduced. BcelShadow - initializeKindedAnnotationVars improved to take account of ITD'd members. LazyMethodGen - removed one layer of annotation indirection! (we were caching the set at too many layers - now there is one less) AnnotationPointcut - For field ITDs this goes back to the aspect to discover the annotation set SignaturePattern - For field ITDs this goes back to the aspect to discover the annotation set
Feature available, see download page: aspectj-DEVELOPMENT-20050324155000.jar fully supported in forthcoming AJDT build...