See
http://mail.openjdk.java.net/pipermail/type-annotations-dev/2013-June/001040.html
*) There's an annoying split between symbol annos and type annos; we have twice the methods we need - I think some work should be done to consolidate existing APIs onto a more stable version where stuff like this:
public boolean hasAnnotations() {
+ return (annotations != null && !annotations.isEmpty());
+ }
+
+ public boolean hasTypeAnnotations() {
+ return (annotations != null && !annotations.isTypesEmpty());
+ }
Is replaced by this:
public boolean hasAnnotations(AnnoKind kind) { ... }
*) I think all methods that modify annotations should not be exposed through Symbol API
*) This should be done via a Symbol flag
- annotationsPendingCompletion
In other words, I would keep the Symbol API light by providing:
*) a way for getting symbol/type annos
*) a way to tell as to whether annotation completion has already happened (i.e. will the above method yield meaningful answer?)
Everything else should be done through a separate class (Annotations), pretty much like we do now, by accessing symbol's metadata and playing with it. I also would remove any back pointer from Annotations to Symbol (if any).