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

Remodel TypeAnnotation to "has" instead of "be" an Annotation

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 24
    • 24
    • core-libs
    • None

      `java.lang.classfile.TypeAnnotation` currently extends `Annotation`. This opens up opportunities for misuse, such as passing a `TypeAnnotation` into `AnnotationValue.OfAnnotation`, where the type information will be lost. And this modeling causes some difficulty in writing to bytes.

      Therefore, I suggest remodeling `TypeAnnotation` to have an `Annotation annotation()` method to prevent such problems.

            liach Chen Liang
            liach Chen Liang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: