devxlogo

February 21, 2020

Modern Java null-handling: explicit null, Objects.requireNonNull, Optional

Simplifying Null Check in Java

A tiny refactor that has survived every Java version from 8 to 25: flip the null check. To guard against a NullPointerException when comparing a string to a literal, most