<div dir="ltr"><div dir="ltr"><div dir="ltr">Hi,</div><div dir="ltr"><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Why wouldn't requireNonNullElse(o1, requireNonNull(o2)) or requireNonNull(requireNonNullElse(o1, o2)) suffice?</div></blockquote><div> </div><div> Because requireNonNullElse requires both arguments are not null. There isn't a method for second argument to return even if it is null.</div><div><br></div><div>Regards,</div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Mark Reinhold <<a href="mailto:mark.reinhold@oracle.com">mark.reinhold@oracle.com</a>>, 29 Eki 2024 Sal, 17:23 tarihinde şunu yazdı:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">2024/10/28 15:40:55 -0400, Emre Kaplan <<a href="mailto:emr3kp@gmail.com" target="_blank">emr3kp@gmail.com</a>>:<br>
> I think java.util.Optional class should have a static method named like<br>
> getOrDefault(Object o, Object default)<br>
<br>
This discussion would be more appropriate on the core-libs-dev list.<br>
<br>
- Mark</blockquote></div>