Friday, December 4, 2026

Thursday, December 3, 2026

Java Optional solving NPE

Optional where introduced into Java 8 in 2014, and extended in Java 9 and 11 and well promoted as solution for Null and prevention of Null Pointer Exceptions (NPE), however. Optional was never intended to solve the NPE problem.

 BTW: NPEs are not the problem, it is a symptom for working with unsafe objects and a missing proper error handling.  

If you want use Optional but more important, create a solid error handling.