Skip to content

Change @AnnotatedFor retention to RUNTIME #1481

@thisisalexandercook

Description

@thisisalexandercook

Currently, the retention policy for @AnnotatedFor is set to SOURCE:

This issue proposes changing the retention policy of @AnnotatedFor to RUNTIME. The motivation for this change is twofold:

  1. This supports the move towards only storing explicitly written annotations in bytecode. By avoiding the storage of implicitly added (defaulted) annotations, the bytecode stays truer to the source. However, we still need a persistent signal that the class was verified. Retaining @AnnotatedFor at runtime provides this necessary metadata (a "paper-trail").

  2. To support the runtime-framework project which inspects and instruments byte code, optionally using this annotation to assume a piece of byte code has been type checked.

This change is also mentioned in #1291 as part of the bytecode storage discussion, but is broken out here to unblock item (2) while other changes are rolled out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions