-
Notifications
You must be signed in to change notification settings - Fork 29
Description
Currently, the retention policy for @AnnotatedFor is set to SOURCE:
checker-framework/checker-qual/src/main/java/org/checkerframework/framework/qual/AnnotatedFor.java
Line 29 in bbf7507
| @Retention(RetentionPolicy.SOURCE) |
This issue proposes changing the retention policy of @AnnotatedFor to RUNTIME. The motivation for this change is twofold:
-
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").
-
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.