typetools / typetools/checker-framework
See which other JDK subtypes of `AutoCloseable` should be `@MustCall("close")`
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 440
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 134
Description
Right now, our JDK model does not annotate AutoCloseable as @MustCall("close"):
It'd be nice if we could annotate it as @MustCall("close") and then annotate those AutoCloseable types that do not manage a resource as @MustCall(""), but it seems this causes issues with excessive warnings. Perhaps we could fix this? If not, we should at some point look through the list of JDK types implementing AutoCloseable and see which other ones should be @MustCall("close"):
https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/AutoCloseable.html
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the referenced AutoCloseable.java declaration and the Java SE AutoCloseable API list. Review the JDK types implementing AutoCloseable and investigate why annotating the interface or non-resource types produces excessive warnings. Done means identifying appropriate @MustCall annotations and resolving or documenting the warning behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100