typetools / typetools/checker-framework

Optional checker: implicit `@MaybePresent` annotations are inserted in `.ajava` files

Open
#6,232 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

  • #6254 by @mernst — closed without merging
Dominant language
Java
Stars
1.1k
Forks
440
Avg merge
1d 12h
Merged PRs (30d)
134

Description

Summary

An execution of WPI on a Java project with the Optional Checker will yield a set of .ajava files where the implicit @MaybePresent annotation is inserted for most (if not all) method arguments and return types, e.g.,

@org.checkerframework.dataflow.qual.Impure
public @org.checkerframework.checker.optional.qual.MaybePresent ResolvedReferenceTypeDeclaration toTypeDeclaration(@org.checkerframework.checker.optional.qual.MaybePresent JavaSymbolSolver this, @org.checkerframework.checker.optional.qual.MaybePresent Node node)

A research discussion with @mernst and @rjust showed that this was not an error; since .ajava files are not meant to be human-read.

That said, I am opening this issue to at least document the possibility that @MaybePresent annotations will no longer be inserted into the .ajava files. The manual suggests that the

[MaybePresent] type is a default value, so programmers do not have to write it

See this manual section for details.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Optional Checker manual section on annotations and review the issue discussion about implicit @MaybePresent annotations in generated .ajava files. Update the documentation to describe this behavior and clarify that .ajava files are not intended for human reading; done means the possibility is accurately documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.