On Fri, 25 Apr 2025 06:28:59 GMT, Alan Bateman <al...@openjdk.org> wrote:

>> Per Minborg has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Make public constuctor private
>
> src/java.base/share/classes/java/lang/StableValue.java line 470:
> 
>> 468:      * @param other to return if the contents is not set
>> 469:      */
>> 470:     T orElse(T other);
> 
> Just to note that JEP 506 is proposing to change ScopedValue.orElse to 
> disallow null. A ScopedValue can be bound to null (e.g. usage in Subject API) 
> so using orElse(null) is problematic. A orNull may be added later if needed. 
> As a StableValue can hold null then it's similar and might be surprising to 
> developers to have the two APIs be different here. Something to look at again 
> after JEP 502 is integrated, I'm not suggesting changing anything in this PR 
> of course.

Yepp. Disallowing `null` is on the list for exploring in the next preview.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/23972#discussion_r2059881042

Reply via email to