Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8015899

Cleanup Annotations API

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Not an Issue
    • Icon: P3 P3
    • tbd
    • 8
    • tools
    • None

      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).

            sadayapalam Srikanth Adayapalam (Inactive)
            jjg Jonathan Gibbons
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: