typetools / typetools/checker-framework

False positive in Resource Leak Checker when type variable has a non-empty MustCall type

Open
#4,837 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

False Positive (false warning or imprecision) ResourceLeakChecker
Dominant language
Java
Stars
1.1k
Forks
440
Avg merge
1d 12h
Merged PRs (30d)
134

Description

The test https://github.com/typetools/checker-framework/blob/master/checker/tests/resourceleak/Issue4815.java demonstrates a false positive from the Resource Leak Checker. I don't know why this warning is issued, because the code looks safe to me. This false positive should be investigated and fixed.

This is a continuation of #4815, which reported a crash from the RLC on that test case. #4821 fixed the crash, but the false positive remains.

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 checker/tests/resourceleak/Issue4815.java and reproduce the Resource Leak Checker warning described in this issue. Review the change from #4821 and trace why the non-empty MustCall type still produces a warning. Done means the false positive is fixed and the test no longer reports the incorrect warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.