ctolkmit / checker-framework

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

Bogus Warning in default interface method #364

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Run the Null Checker on the class below

package test;

import java.util.Set;
import java.util.stream.Stream;

class Test {
    interface Foo {
        Set<Object> getSet();

        default void foo() {
            Stream<Object> stream = getSet().stream();
            stream.toString();
        }
    }

    static abstract class Bar {
        abstract Set<Object> getSet();

        void bar() {
            Stream<Object> stream = getSet().stream();
            stream.toString();
        }
    }
}

What is the expected output? What do you see instead?
Expected: no errors
Actual: Error at line 12: dereference of possibly-null reference stream 
stream.toString();
test\Test.java:12: error: [dereference.of.nullable] dereference of 
possibly-null reference stream
            stream.toString();
            ^
1 error

What version of the product are you using? On what operating system?
1.8.6/Windows 8/Java 8

Original issue reported on code.google.com by ClovisSe...@gmail.com on 28 Sep 2014 at 8:23

GoogleCodeExporter commented 9 years ago
Hi Clovis,

Thanks for the report! I have reproduced this issue and have created a fix that 
should go out in the Feb 1 release.

Original comment by mcart...@cs.washington.edu on 26 Jan 2015 at 10:57

GoogleCodeExporter commented 9 years ago
Fixed in release 1.8.10 of the Checker Framework.

Original comment by mcart...@cs.washington.edu on 30 Jan 2015 at 10:57