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

Merge support for AnnotationType builders/writers into support for other types

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 15
    • Fix Version/s: 15
    • Component/s: tools
    • Labels:

      Description

      ClassBuilder/ClassWriter/ClassWriterImpl already support enums, records, interfaces and classes. But annotation types are still handled separately, in AnnotationTypeBuilder/AnnotationTypeWriter/AnnotationTypeWriterImpl.
      This leads to duplicated code and duplicated effort to maintain the parts of the code that are similar. For example, fields in annotation types are handled as ANNOTATION_FIELD, even though they are logically the same as FIELD.

      ClassBuilder and friends have the ability to handle different flavors of members, such as enum constants, as distinct from fields. We can leverage that ability to handle required and optional elements of annotation types.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jjg Jonathan Gibbons
              Reporter:
              jjg Jonathan Gibbons
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: