Optional.or name <was> Re: RFR 8080418 Add Optional.or()

Stephen Colebourne scolebourne at joda.org
Wed Oct 14 09:33:43 UTC 2015


Maybe "an optional equivalent to {@code this}"

The original text is quite obtuse.

Stephen



On 14 October 2015 at 09:54, Paul Sandoz <paul.sandoz at oracle.com> wrote:
>
>> On 13 Oct 2015, at 22:43, Stephen Colebourne <scolebourne at joda.org> wrote:
>>
>> I'd prefer to see "this" mentioned:
>>
>> "If a value is not present, invoke the specified supplier to provide
>> the result, otherwise return {@code this}"
>>
>> While I understand the original form gave some spec wiggle room, it
>> also made the method far more mysterious.
>>
>
> That wiggle room is useful to avoid baking in any assumptions about the identity of the returned Optional.
>
> Paul.



More information about the core-libs-dev mailing list