IDEA-163489 Inspection "Constant conditions & exceptions" with option "Suggest @Nullable annotation for methods" warns about lambdas

This commit is contained in:
peter
2016-11-04 15:15:16 +01:00
parent cc7e7139df
commit 55a07ffd43
3 changed files with 24 additions and 1 deletions
@@ -0,0 +1,16 @@
import java.util.Random;
import java.util.List;
class TestCompilerWarnings {
long foo(List<String> l) {
return l.stream().map(s -> {
if (new Random().nextInt() > 2) {
return null;
}
else {
return s;
}
}).count();
}
}