Re:The Next Step for Generics
by richardwhiuk on Thursday June 18, 2020 @12:56PM
(#23565053)
The code ends up looking like:
Optional<Integer> foo;
//....
if (foo != null) {
foo.and_then(new Consumer () {
function accept(Integer foo) {
}
});
}
In any case, there already exist solutions in place:
https://checkerframework.org/manual/#example-use
https://github.com/uber/NullAway