typetools / typetools/checker-framework

Version of @Pure that persists through side effects

Open
#1,740 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
1.1k
Forks
440
Avg merge
1d 12h
Merged PRs (30d)
134

Description

Checker output and YourClassName.java reproduction case attached.

This is fairly common for use of nano protos where initialization might occur in between copying of data based on nullness of a field.

A workaround for now is to use a local variable before the initialization of mutableData and then assign after initialization based on the local variable.

nullness-issue-pure.zip

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 by unpacking nullness-issue-pure.zip and reading the attached YourClassName.java reproduction alongside the Checker output. Trace how @Pure handles side effects when nullness-based data copying surrounds mutableData initialization. Done means the reproduction no longer reports the described error while preserving the intended nullness checking behavior.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.