Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* using it in a fully-annotated library nor in an application that does not export APIs for
* clients.
*
* <p>This annotation has no effect unless the {@code
* <p>This annotation is retained in bytecode but has no effect unless the {@code
* -AuseConservativeDefaultsForUncheckedCode=source} command-line argument is supplied. Ordinarily,
* the {@code -AuseConservativeDefaultsForUncheckedCode=source} command-line argument causes
* unannotated locations to be defaulted using conservative defaults, and it suppresses all
Expand All @@ -26,7 +26,7 @@
* @checker_framework.manual #compiling-libraries Compiling partially-annotated libraries
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.PACKAGE})
public @interface AnnotatedFor {
/**
Expand Down
4 changes: 3 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ The Nullness Checker now recognizes references to private, final fields with zer

The `ClassBound` annotation can now be used with anonymous types.

The `AnnotatedFor` annotation is now retained in bytecode.

**Implementation details:**

The `AbstractNodeVisitor` now has more summary methods, following the class hierarchy of `Node` and conceptual categories.

**Closed issues:**

eisop#1247, eisop#1263, eisop#1310, typetools#7096.
eisop#1247, eisop#1263, eisop#1310, eisop#1481, typetools#7096.


Version 3.49.5 (June 30, 2025)
Expand Down
2 changes: 1 addition & 1 deletion docs/manual/annotating-libraries.tex
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@

The \refqualclass{framework/qual}{AnnotatedFor} annotation, written on a
class, indicates that the class has been annotated for certain type
systems. For example, \<@AnnotatedFor(\ttlcb"nullness", "regex"\ttrcb)> means that
systems. This annotation will be retained in bytecode. For example, \<@AnnotatedFor(\ttlcb"nullness", "regex"\ttrcb)> means that
the programmer has written annotations for the Nullness and Regular
Expression type systems. If one of those two type-checkers is run,
the \<-AuseConservativeDefaultsForUncheckedCode=source,bytecode> command-line argument
Expand Down
6 changes: 3 additions & 3 deletions docs/manual/faq.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1612,9 +1612,9 @@

\subsectionAndLabel{Why are type annotations declared with \<@Retention(RetentionPolicy.RUNTIME)>?}{faq-runtime-retention}

Annotations such as \refqualclass{checker/nullness/qual}{NonNull} are
declared with
\<\sunjavadocanno{java.base/java/lang/annotation/Retention.html}{Retention}(RetentionPolicy.\sunjavadoc{java.base/java/lang/annotation/RetentionPolicy.html\#RUNTIME}{RUNTIME})>. In other words,
Annotations such as \refqualclass{checker/nullness/qual}{NonNull}
and \refqualclass{framework/qual}{AnnotatedFor} are declared with
\<\sunjavadocanno{java.base/java/lang/annotation/Retention.html}{Retention}(RetentionPolicy.\sunjavadoc{java.base/java/lang/annotation/RetentionPolicy.html\#RUNTIME}{RUNTIME})>. In other words,
these type annotations are available to tools at run time. Such run-time
tools could check the annotations (like an \<assert> statement), type-check
dynamically-loaded code, check casts and \<instanceof> operations, resolve
Expand Down
Loading