biddyweb / checker-framework

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

Bogus Warning in static interface method #365

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.Collections;
import java.util.Set;

public class Test {
    Set<Object> getSet() {
        return Collections.emptySet();
    }

    static class Foo1 {
        static void foo(Test obj) {
            Set<Object> set1 = obj.getSet();
            test(set1);
        }
    }

    interface Foo2 {
        static void foo(Test obj) {
            Set<Object> set2 = obj.getSet();
            test(set2);
        }
    }

    static boolean test(Set<Object> set) {
        return true;
    }
}

What is the expected output? What do you see instead?
Expected: no errors
Actual: test\Test.java:21: error: [argument.type.incompatible] incompatible 
types in argument.
            test(set2);
                 ^
  found   : @UnknownInitialization @Nullable Set<@Initialized @NonNull Object>
  required: @Initialized @NonNull Set<@Initialized @NonNull Object>
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:45

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