The following test case works with https://github.com/typetools/checker-framework, while gets false positive with the opprop version.
import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.*;
class A {
public HashMap<Integer, Date> call_hashmap = new HashMap<>();
public HashMap<Integer, Date> getMap() {return call_hashmap;}
}
class NonNullMapValue {
public void process_unmatched_procedure_entries(A a) {
for (Integer i : a.getMap().keySet()) {
@NonNull Date d = a.getMap().get(i);
}
}
}
gets false positive as
case/KeyForDemo.java:33: error: [assignment.type.incompatible] incompatible types in assignment.
@nonnull Date d = a.getMap().get(i);
^
found : @initialized @nullable Date
required: @UnknownInitialization @nonnull Date
1 error
The following test case works with https://github.com/typetools/checker-framework, while gets false positive with the opprop version.
gets false positive as
case/KeyForDemo.java:33: error: [assignment.type.incompatible] incompatible types in assignment.
@nonnull Date d = a.getMap().get(i);
^
found : @initialized @nullable Date
required: @UnknownInitialization @nonnull Date
1 error