typetools / typetools/checker-framework
Error recognizing Class.isInstance filters out null
Open
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:
- mkdir -p net/mtu/eggplant/checker/
- cd net/mtu/eggplant/checker/ tar -xzf isinstance_null.tar.gz
- 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
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 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