Community
Participate
Working Groups
I just found out that AJCompilationUnitStructureRequestor does not add annotations to the java model. This means that the method AspectElement.getAnnotations() (and any IJavaElement created by AJCompilationUnitStructureRequestor) will always return an empty array, regardless of how many annotations are actually in the source. It seems that the fix for this is a bit bigger than I had thought. I am including a patch that is the start of the implementation for AJDT 1.6.5 (to make things more complicated, this class has been massively refactored for 1.7. I'm not sure how big of an issue this is. So far, no one has missed this behavior. I only noticed this missing implementation because the new method AJCompilationUnit.getAllAspects was failing to return aspects with @AspectJ syntax. If this missing implementation turns out to be important, I will revisit, but until then, I will probably not make any changes.
Created attachment 130189 [details] partial implementation. This is very rough and doesn't even compile. It is just a way to suggest how the final implementation might look.
Just to make things clear, this lack of functionality is not affecting anything to my knowledge. I am currently not requiring it because AJCompilationUnit.getAllAspects is implemented by asking the AJProjectModelFacade to see if a type is actually an aspect through annotation. This works fine, but it is probably slower than creating the AJCompilationUnit correctly in the first place.
Move to the 2.0.2 release.
No longer slated for the next release.