typetools / typetools/checker-framework

Error recognizing Class.isInstance filters out null

Open
#7,365 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Checker version 3.52.0.
Java version: 21.0.8

To reproduce:

  1. mkdir -p net/mtu/eggplant/checker/
  2. cd net/mtu/eggplant/checker/ tar -xzf isinstance_null.tar.gz
  3. Build this with checker. Result is
/home/jpschewe/projects/checker-bugs/src/main/java/net/mtu/eggplant/checker/isinstance_null/Test.java:21: error: [argument] incompatible argument for parameter goal of Test.findRangeShortDescriptionWithTitle.
                        .map(g -> findRangeShortDescriptionWithTitle(title, g))//
                                                                            ^
  found   : @Initialized @PolyNull Goal
  required: @Initialized @NonNull Goal
1 error

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 the attached isinstance_null.tar.gz reproduction and the reported src/main/java/net/mtu/eggplant/checker/isinstance_null/Test.java at the stream map call. Run Checker Framework 3.52.0 with Java 21, then trace how Class.isInstance filters are analyzed. Done means the reproduction no longer reports the incompatible Goal argument while preserving the relevant nullness checking.

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.