Possibility of using preview features(StableValue) in java.desktop module

Philip Race philip.race at oracle.com
Fri Sep 26 17:49:50 UTC 2025


I just saw https://openjdk.org/jeps/526

"This API first previewed inJDK 25 
<https://openjdk.org/projects/jdk/25/>viaJEP 502: Stable Values 
<https://openjdk.org/jeps/502>.
Based on experience and feedback, we here propose to revise and 
re-preview the API inJDK 26 <https://openjdk.org/projects/jdk/26/>."

Seems to me we should wait for that to be integrated.

-phil.

On 9/25/25 2:17 PM, Sergey Bylokhov wrote:
> On 9/25/25 12:59, Philip Race wrote:
>> I have no general objection to this.
>> I would use it where lazy initialization will provide a clear benefit,
>> but not as a general replacement for final.
>
> I did not even consider using StableValue as the 'super final', only 
> as a possible way to implement singletons (which we usually do via 
> double-checked locking, the holder idiom, or sometimes even with 
> incorrect synchronization).
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/client-libs-dev/attachments/20250926/ac1b51e8/attachment-0001.htm>


More information about the client-libs-dev mailing list