Skip to content
Draft
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 @@ -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
3 changes: 3 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ Version 3.49.5-eisop1 (July ??, 2025)

**User-visible changes:**

The new command-line option '-AnoBytecodeStorage' configures the Checker Framework to not store defaulted annotations in
bytecode.

The new command-line option `-AonlyAnnotatedFor` suppresses all type-checking errors and warnings outside the scope of
a corresponding `@AnnotatedFor` annotation.
Note that the `@AnnotatedFor` annotation must include the checker's name to enable warnings from that checker.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,10 @@
// org.checkerframework.framework.source.SourceChecker.useConservativeDefault
"useConservativeDefaultsForUncheckedCode",

// Whether to store defaulted annotations in bytecode.
// org.checkerframework.framework.type.AnnotatedTypeFactory.postProcessClassTree
"noBytecodeStorage",

// Whether to assume sound concurrent semantics or
// simplified sequential semantics
// org.checkerframework.framework.flow.CFAbstractTransfer.sequentialSemantics
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1532,10 +1532,14 @@ public void preProcessClassTree(ClassTree classTree) {}
* <p>The default implementation uses this to store the defaulted AnnotatedTypeMirrors and
* inherited declaration annotations back into the corresponding Elements. Subclasses might want
* to override this method if storing defaulted types is not desirable.
*
* @param tree the ClassTree that has been processed
*/
public void postProcessClassTree(ClassTree tree) {
TypesIntoElements.store(processingEnv, this, tree);
DeclarationsIntoElements.store(processingEnv, this, tree);
if (!checker.hasOption("noBytecodeStorage")) {
TypesIntoElements.store(processingEnv, this, tree);
DeclarationsIntoElements.store(processingEnv, this, tree);
}

if (typeInformationPresenter != null) {
typeInformationPresenter.process(tree, getPath(tree));
Expand Down
Loading