typetools / typetools/checker-framework

Incorrect dereference.of.nullable warning in the scope of an enhanced for loop

Open
#565 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Nullness checking of Daikon is failing with the following error:

daikon/AnnotateNullable.java:151: warning: [dereference.of.nullable] dereference of possibly-null reference child_rel
          PptTopLevel child = child_rel.child;
                              ^

A workaround is to change one line in daikon/java/daikon/AnnotateNullable.java from

for (PptRelation child_rel : ppt.children) {

to

for (int i = 0; i < ppt.children.size(); i++) {
    PptRelation child_rel = ppt.children.get(i);

This build shows that workaround succeeding. A minimized test case on tern.cs.washington.edu is needed so the root cause can be found and the issue fixed.

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 daikon/java/daikon/AnnotateNullable.java and the enhanced for loop over ppt.children that produces the dereference.of.nullable warning. Reduce this case to a minimized Java test case, using the linked type-checking build results as a reference, so the root cause can be identified and the warning is fixed.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.