typetools / typetools/checker-framework
A static variable that's a key for a field is a key for the field in every object
Open
Nobody has claimed this yet.
bug
False Positive (false warning or imprecision)
JavaExpressions
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 440
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 134
Description
When a static field has type @KeyFor("this.map"), then it should be known to be a key into field map in every instance, not just this.
There is a test case in file tests/nullness/KeyForStaticField.java.
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 tests/nullness/KeyForStaticField.java and run the test case to observe the current behavior. Trace the Checker Framework handling for @KeyFor on static fields, then update it so the annotation is recognized as a key for the named map in every instance and confirm the test passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100