3 ms·
That’s just a convenience for theField == null ? Optional.empty() : Optional.of(theField); As Optional.of will raise an NPE if given a null value. It doe
by masklinn 4y ago
That’s just a convenience for
theField == null ? Optional.empty() : Optional.of(theField);
As Optional.of will raise an NPE if given a null value.
It doesn’t change the issue that the Optional itself can be null, and that null is its default value.