-
Enhancement
-
Resolution: Unresolved
-
P3
-
None
-
None
-
None
Create a preview implementation of the proposed "Stable Values & Collections" API.
# Summary
Introduce a _Stable Values & Collections API_, which provides performant immutable value holders where elements
are initialized _at most once_. Stable Values & Collections offer the performance and safety benefits of
final fields, while offering greater flexibility as to the timing of initialization.
# Goals
* Provide an easy and intuitive API to describe value holders that can change at most once.
* Decouple declaration from initialization without significant footprint or performance penalties.
* Reduce the amount of static initializer and/or field initialization code.
* Uphold integrity and consistency, even in a multi-threaded environment.
For more details, see the draft JEP: https://openjdk.org/jeps/8312611
# Summary
Introduce a _Stable Values & Collections API_, which provides performant immutable value holders where elements
are initialized _at most once_. Stable Values & Collections offer the performance and safety benefits of
final fields, while offering greater flexibility as to the timing of initialization.
# Goals
* Provide an easy and intuitive API to describe value holders that can change at most once.
* Decouple declaration from initialization without significant footprint or performance penalties.
* Reduce the amount of static initializer and/or field initialization code.
* Uphold integrity and consistency, even in a multi-threaded environment.
For more details, see the draft JEP: https://openjdk.org/jeps/8312611
- relates to
-
JDK-8333791 Fix memory barriers for @Stable fields
-
- Resolved
-
- links to
-
Review openjdk/jdk/18794