2 ms·
What about the standard library? What about other libraries that you depend on? Can't those introduce NPEs?
by lolinder 2y ago
What about the standard library? What about other libraries that you depend on? Can't those introduce NPEs?
- wh0knows 2y agoInputs to standard libraries will obviously never NPE if you pass in a non-null value. For outputs, a lot of standard collection .get() calls are unnecessary when you’re working with small collections or Optionals, where you simply use stream, filter, ifPresent. Or simply wrap the return with Optional.ofNullable, checkstyle will not accept it if you don’t.