Java developers and enthusiasts are eagerly awaiting the release of JDK 23 and JDK 24, with the latest updates signaling significant advancements in the platform. As of August 27, 2024, JDK 23, the second non-Long-Term Support (LTS) release after JDK 21, has entered its second candidate release phase, as announced by Mark Reinhold, Chief Architect of the Oracle Java Platform Group.
The mainline source code was branched to the JDK’s stable code repository in early June 2024, during the Rampdown First Phase, defining the feature set for JDK 23. Only critical issues, such as regressions or severe functional problems, will be addressed through the Fix-Request process. According to the release schedule, JDK 23 is set to be officially released on September 17, 2024, with 12 new features presented in the form of JEPs (Java Enhancement Proposals). These features can be categorized into four main areas: Core Java libraries, Java Language Specification, HotSpot, and Java tools.
Core Java Libraries
Six new features fall under the Core Java Libraries:
- JEP 466: Class-File API (Second Preview) – This JEP introduces a new API for reading and writing class files, improving the functionality and maintainability of the platform.
- JEP 469: Vector API (Eighth Incubator) – The Vector API continues to evolve, aiming to provide high-performance vectorized operations for CPUs with vector instructions.
- JEP 471: Deprecate the Memory-Access Methods in sun.misc.Unsafe for Removal – This JEP deprecates certain methods for removal, promoting safer alternatives and reducing reliance on the
sun.misc.Unsafe
class. - JEP 473: Stream Gatherers (Second Preview) – Stream Gatherers enhance the Java Stream API, allowing for more efficient and expressive parallel data processing.
- JEP 480: Structured Concurrency (Third Preview) – This feature promotes safer and more efficient concurrent programming by introducing new language constructs.
- JEP 481: Scoped Values (Third Preview) – Scoped Values enable better management of temporary variables, reducing the risk of errors in concurrent code.
Java Language Specification
Four new features are part of the Java Language Specification:
- JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) – This JEP extends the use of primitive types in pattern matching,
instanceof
, andswitch
expressions, enhancing type safety. - JEP 476: Module Import Declarations (Preview) – This proposal introduces a new syntax for importing modules, streamlining code organization and reducing clutter.
- JEP 477: Implicitly Declared Classes and Instance Main Methods (Third Preview) – This feature, now in its third preview, simplifies the declaration of anonymous classes and main methods, improving code readability.
- JEP 482: Flexible Constructor Bodies (Second Preview) – Building on the groundwork laid by JEP 447, this JEP allows for more flexibility in constructor bodies, enabling statements before
this()
orsuper()
calls while maintaining safety and initialization guarantees.
HotSpot
One feature is related to HotSpot:
- JEP 474: ZGC: Generational Mode by Default – This JEP makes the Z Garbage Collector’s generational mode the default, improving performance and reducing latency for certain workloads.
Java Tools
One feature is part of the Java tools:
- JEP 467: Markdown Documentation Comments – This JEP introduces support for using Markdown syntax in documentation comments, enhancing the readability and formatting of documentation.
Several of these features are the result of ongoing projects like Amber, Loom, Panama, and Valhalla, which incubate components that are later integrated into the JDK. For instance, JEP 482, Flexible Constructor Bodies, is a second preview based on feedback from JEP 447, which was delivered in JDK 22. This JEP relaxes restrictions on accessing fields before an explicit constructor call. The JEP’s initial specification was provided by Oracle Technical Advisor Gavin Bierman for community review and feedback.
JEP 477, now in its third preview, incorporates feedback from previous iterations, enhancing the functionality of implicitly declared classes and instance main methods. The project has undergone multiple renaming and preview stages, reflecting its evolution over time.
In conclusion, JDK 23 and JDK 24 promise to bring a wealth of improvements and new capabilities to the Java ecosystem, further solidifying its position as a leading platform for software development. With a focus on performance, safety, and developer productivity, these releases are set to shape the future of Java programming. As the release dates draw near, the Java community is looking forward to exploring and leveraging these enhancements in their projects.
【source】https://mp.weixin.qq.com/s/p84egOfeqIPVq7glht8W3w
Views: 0