Victor Rentea1 article

Latest post Avoiding NullPointerException

The terrible NullPointerException (NPE for short) is the most frequent Java exception occurring in production, according to a 2016 study. In this article we’ll explore the main techniques to fight it: the self-validating model and the Optional wrapper.

You should consider upgrading your entity model to either reject a null via self-validation or present the nullable field via a getter that returns Optional. The effort of changing the getters of the core entities in your app is considerable, but along the way, you may find many dormant NPEs.

  • Victor Rentea
December 22, 2020
1-1 of 1

Subscribe to foojay updates:

https://foojay.io/today/author/victor-rentea/feed/
Copied to the clipboard