Community
Participate
Working Groups
In the AST annotations are considered modifiers, they are returned in BodyDeclaration.modifiers(). I think the Java IElementChangedListener should treat annotations and modifiers in a similar manner. Currently the IJavaElementDelta returns specific information on where a particular modifier twas add/removed/changed (it tells you which method, field, type was changed). With annotations all you receive is notification that the content of the CompilationUnit was changed. You do not know whether an annotation was changed or where one might have been added or removed.
Annotations currently have no representation at the Java model level (see bug 79112). Once bug 79112 is resolved, then it would indeed make sense to have added/removed/changed notifications for these elements.
post 3.2
*** Bug 190394 has been marked as a duplicate of this bug. ***
Reopening since work has started on bug 79112.
Fix for bug 79112 actually fixes this bug. To get what annotations that have been added/removed/changed use IJavaElementDelta#getAnnotationDeltas(). *** This bug has been marked as a duplicate of bug 79112 ***
Verified for 3.4M3 using I20071029-0010 build.