typetools / typetools/checker-framework

Fix the Interning Checker to treat autoboxed integer-like values between -128 and 127 as interned

Open
#766 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Currently the Interning Checker is too conservative: it does not know that, when autoboxing integer-like values between -128 and 127, the result is interned. The Constant Value Checker can be used for this purpose to improve the precision of the Interning Checker.

A test case is available at checker/tests/interning/BoxingInterning.java but is currently disabled.
There is also a test at checker/tests/interning/Autoboxing.java that is enabled but could be updated to require higher precision.

See also issue #84.

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/interning/BoxingInterning.java and re-enable its test case, then compare it with checker/tests/interning/Autoboxing.java. Read how the Constant Value Checker can support the Interning Checker. Done means autoboxed integer-like values from -128 through 127 are recognized as interned and both tests require the improved precision.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.