ctolkmit / checker-framework

Automatically exported from code.google.com/p/checker-framework
0 stars 0 forks source link

Nullness Checker nested class initialization #354

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
class Outer {

    String a;
    {
        Object o = new Object() {
            @Override
            public String toString() {
                return a.toString();
            }
        }.toString();

        // This is needed to avoid the initialization.fields.uninitialized warning.
        // The NPE still occurs
        a = ""; 
    }
}

What is the expected output? What do you see instead?
I expect a warning on the "a" dereference, but there is none.

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

Please provide any additional information below.
This might require adjusting dataflow to pass propagate the current 
initialization store from the outer class to the evaluations in the inner class.

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

GoogleCodeExporter commented 9 years ago

Original comment by mcart...@cs.washington.edu on 22 Jan 2015 at 12:57