Re:My most common code review suggestions
by hyperpallium on Thursday December 07, 2017 @08:28AM
(#15869776)
Semantically, is that different from using a reference variable without first checking it !=null?
Also, isn't there a static code analysis tool that checks at compile-time that reference variables annotated as @non_nullable can never be null?
Re:My most common code review suggestions
by AstralStorm on Thursday December 07, 2017 @09:33AM
(#15870226)
There is exactly one place where you might want to catch an NPE: top level global exception handler for logging and debugging.
The problem with optionals - as Sonar will complain about - is that people will call `.get()` on an Optional without first checking `.isPresent()` for example.
Lots of things in the language that allow you to shoot yourself in the foot that other languages have solved.