typetools / typetools/checker-framework

Nullness Checker Static Initialization

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

Nobody has claimed this yet.

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

Description

What steps will reproduce the problem?

The Nullness Checker fails to warn of a NullPointerException for this code:

class StaticDataflow {

    static String a;

    static {
        a.toString();
    }
}

What is the expected output? What do you see instead?
I expect a warning on the dereference of "a", but no error is given.

What version of the product are you using? On what operating system?
261dee828a0a

Original issue reported on code.google.com by mcart...@cs.washington.edu on 4 Sep 2014 at 9:35

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

Reproduce the Nullness Checker behavior with the StaticDataflow example and the reported revision 261dee828a0a, focusing on static initialization and the dereference of the uninitialized field a. The fix is complete when the checker emits a warning for a.toString() in the static initializer.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.