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

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

    XMLWordPrintable

Details

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

    Description

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

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: