typetools / typetools/checker-framework
Support for taking over the ownership of the collection/array/vararg
Open
Nobody has claimed this yet.
ResourceLeakChecker
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 440
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 134
Description
A simple example is as follows:
For the resources obtained outside
this works:
class Closeables implements Closeable {
final @Owning Closeable res1;
final @Owning Closeable res2;
Closeables(@Owning r1, @Owning r2) {
res1 = r1;
res2 = r2;
}
...
}
this does not work:
class Closeables implements Closeable {
final @Owning Closeable[] res;
Closeables(@Owning Closeable... r) {
res = r;
}
...
}
Is there a way to take over the ownership each item of a vararg / array / collection?
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 Java examples in the issue and investigate how ownership transfer is currently handled for individual parameters versus arrays, varargs, and collections. The issue does not name implementation files or tests; completion would require an agreed behavior and verification for taking ownership of each contained item.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100