Java JEPs: Computed Constants and Stabilization of the FFM API
The article discusses the introduction of new JEPs in Java, specifically focusing on Computed Constants and the stabilization of the Foreign Function & Memory (FFM) API. JDK 21 marks the stabilization of several APIs, with the FFM API being released as a Preview. However, a JEP Draft has been published, indicating that the final version of the FFM API will be available in an upcoming Java version, possibly JDK 22. The JEP concentrates on finalizing the FFM API and includes enhancements such as the addition of the Enable-Native-Access
manifest attribute, automatic creation of C function descriptors, increased support for native variable-size arrays, and compatibility with various character sets in native strings. Additionally, the article discusses the concept of Computed Constants, which aims to bridge the gap between immutability and initialization flexibility in Java. This feature is similar to constructs found in languages like C# and Kotlin. Overall, these developments provide Java developers with new tools and capabilities for their programming projects.