2026/9/24 -ofNullable() checks the supplied value and creates an Optional containing the value when it is non-null or returns an empty Optional when it is null.
2026/6/30 -Reports uses of Optional.ofNullable() where always null or always not-null argument is passed. There's no point in using Optional.ofNullable() in this case: ...
2026/6/28 -This class provides various methods to check the presence of a value and handle null cases that reduces the chances of NullPointerException in Java programs.
2026/10/1 -Optional.ofNullable(value): Creates an Optional containing the value if it is non-null; otherwise, returns an empty Optional. Example 1: Using empty() and of().
2日前 -The most common Optional anti-pattern is wrapping a potentially null value in an Optional , only to immediately invoke .get() without checking if a value is ...
2026/10/20 -In Spring Boot 4, JSpecify's @Nullable annotation should be used to indicate that a parameter can be null. This recipe adds @Nullable to parameters ...
2026/7/13 -“Optional” is therefore about presence, while “nullable” is about the value domain. Property declaration, Missing, null, String value. Optional string, Valid ...
2026/6/29 -Takeaway: Optional is not a null wrapper to sprinkle everywhere. It is a way to make absence visible at API boundaries and to handle it with transformations ...
2026/10/27 -Optional as Method Parameter — Why It's a Bad Idea Many Java teams use Optional for “maybe‑null” arguments, but this breaks API contracts and trips Spring, ...
2026/5/13 -I thought nullable DTO fields were enough for PATCH. My rule was simple: if a field is missing or null, treat both the same. Client sends only what it wants ...