News and views from members of the Java team at Oracle
Lazily initializing fields in Java is error-prone and undermines constant-folding. JDK 26 comes with JEP 526, which previews LazyConstant, a type that lazily initializes a value through a given Supplier. It executes that supplier at most once successfully and then assigns the value to a field annotated with @Stable, which allows constant folding. This API is also a poster child for how OpenJDK develops and evolves features.
Inside Java Newscast #101 on reflective final field mutation
Inside Java Podcast #37 with Per Minborg - Efficient Initialization Using Stable Values
Inside Java Podcast #42 with John Rose - From Sumatra to Panama, from Babylon to Valhalla
dev.java: the destination for Java developers
OpenJDK: the place to collaborate on the Java Platform and related projects
Oracle Java: the #1 programming language and development platform
The "Inside Java Newscast" is a monthly YouTube show that we also publish as a podcast. For Inside Java Podcast episodes, check out the podcast page or our YouTube playlist. For more Java news, subscribe to our RSS feed and follow @Java on X.