#StableValues
The new StableValues JEP for #java is now one step closer to being finalized: openjdk.org/jeps/8312611

Stable Values will provide the benefits of final fields but with flexible initialization, much like combining the benefits of final and non-final fields.
January 21, 2025 at 6:44 AM
for those of you following along with our home edition... think of it like this...
Stables have horses... horses are fast... so StableValues will be fast like horses.
March 1, 2025 at 12:22 AM
Time to replace StableValues with LazyConstants. I like the results now that LazyConstant extends the Supplier interface #java26
March 20, 2026 at 12:59 PM
Struggling with thread-safe lazy initialization and can’t wait for #StableValues? Two new articles cover Double-Checked Locking and the Initialization-on-Demand Holder idioms in Java:

www.happycoders.eu/java/double-...

www.happycoders.eu/java/initial...

#Java #StableValues #DoubleCheckedLocking
Double-Checked Locking in Java
Discover the Double-Checked Locking pattern in Java: Optimize thread-safe, lazy object initialization without performance losses.
www.happycoders.eu
May 9, 2025 at 6:56 AM
Just published:

"Stable Values in Java 25: Finally Initialize Values Safely!"

Learn how this new preview feature solves common multi-threading initialization problems. No need to wait for Java 25 - get the details now!

www.happycoders.eu/java/stable-...

#Java #Java25 #StableValues
Stable Values in Java - Finally Initialize Values Safely!
What are Stable Values and how do you use them? What are Stable Lists, Stable Maps, and Stable Functions? How do Stable Values work internally?
www.happycoders.eu
April 9, 2025 at 10:09 AM
A Sneak Peek at the Stable Values API. Learn how to create lazy Lists and Maps with the same performance as if their elements were constant values!

#java #jdk

www.youtube.com/watch?v...
A Sneak Peek at the Stable Values API
In this talk, we will demystify the work that is going on with the "StableValues API" with the associated battle cry "Codes like lazy initialization, performs like a constant." Some internal JDK classes rely heavily on the annotation `jdk.internal.vm.annotation.@Stable` to mark scalar and array fields whose values or elements will change *at most once*, thereby providing crucial performance, energy efficiency, and flexibility benefits. But the powerful @Stable annotation cannot be used directly in Java applications, thereby severely restricting its applicability. The StableValue API rectifies this imbalance between internal and client code by providing safe wrappers around the `@Stable` annotation. Hence, all the important benefits of `@Stable` are now made available to regular Java developers and third-party library developers. Learn how to create lazy Lists and Maps with the same performance as if their elements were constant values! Presented by Per Minborg - Consulting Member of Technical Staff (Java Platform Group - Oracle) at JavaOne 2025 (CA, March 2025). All JavaOne 2025 talks ➤ https://www.youtube.com/playlist?list=PLX8CzqL3ArzVV1xRJkRbcM2tOgVwytJAi ➤ https://openjdk.org/jeps/502 ➤ https://inside.java/ Tags: #Java #JVM #OpenJDK SES1643
www.youtube.com
July 22, 2025 at 7:16 PM