BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News OpenJDK News Roundup: Instance Main Methods, Flexible Constructor Bodies, Module Import Declarations

OpenJDK News Roundup: Instance Main Methods, Flexible Constructor Bodies, Module Import Declarations

There was a flurry of activity in the OpenJDK ecosystem during the week of November 4th, 2024, highlighting: five JEPs, having successfully completed their respective reviews, are now Targeted for JDK 24; five new JEPs have been Proposed to Target for JDK 24 and will be under review during the week of November 11th, 2024; and two JEP drafts that have been promoted to Candidate status.

Targeted

JEP 493, Linking Run-Time Images without JMODs, has been promoted from Proposed to Target to Targeted for JDK 24. This JEP proposes to "reduce the size of the JDK by approximately 25% by enabling the jlink tool to create custom run-time images without using the JDK's JMOD files." This feature must explicitly be enabled upon building the JDK. Developers are now allowed to link a run-time image from their local modules regardless where those modules exist.

JEP 491, Synchronize Virtual Threads without Pinning, has been promoted from Proposed to Target to Targeted for JDK 24. This JEP proposes to "improve the scalability of Java code that uses synchronized methods and statements by arranging for virtual threads that block in such constructs to release their underlying platform threads for use by other virtual threads." The intent is to eliminate "nearly all cases of virtual threads being pinned to platform threads, which severely restricts the number of virtual threads available to handle an application's workload."

JEP 488, Primitive Types in Patterns, instanceof, and switch (Second Preview), has been promoted from Proposed to Target to Targeted for JDK 24. This JEP, under the auspices of Project Amber, proposes a second round of preview, without change, to gain additional experience and feedback from the previous round or preview, namely: JEP 455, Primitive Types in Patterns, instanceof, and switch (Preview), delivered in JDK 23. This feature enhances pattern matching by allowing primitive type patterns in all pattern contexts, and extending instanceof and switch to work with all primitive types. More details may be found in this draft specification by Aggelos Biboudis, Principal Member of Technical Staff at Oracle.

JEP 486, Permanently Disable the Security Manager, has been promoted from Proposed to Target to Targeted for JDK 24. This JEP proposes to permanently disable the SecurityManager class since it was deprecated with JEP 411, Deprecate the Security Manager for Removal, delivered in JDK 17. While it was possible for developers to still enable the SecurityManager class while it has been deprecated, this functionality will be removed as the next step for ultimate removal.

JEP 450, Compact Object Headers (Experimental), has been promoted from Proposed to Target to Targeted for JDK 24. This JEP, inspired by Project Lilliput, proposes to "reduce the size of object headers in the HotSpot JVM from between 96 and 128 bits down to 64 bits on 64-bit architectures." This feature is disabled by default as it is considered experimental and may cause unintended consequences if enabled by a developer.

Proposed to Target

JEP 495, Simple Source Files and Instance Main Methods (Fourth Preview), has been promoted from Candidate to Proposed to Target for JDK 24. This JEP proposes a fourth preview without change (except for a second name change), after three previous rounds of preview, namely: JEP 477, Implicitly Declared Classes and Instance Main Methods (Third Preview), delivered in JDK 23; JEP 463, Implicitly Declared Classes and Instance Main Methods (Second Preview), delivered in JDK 22; and JEP 445, Unnamed Classes and Instance Main Methods (Preview), delivered in JDK 21. This feature aims to "evolve the Java language so that students can write their first programs without needing to understand language features designed for large programs." This JEP moves forward the September 2022 blog post, Paving the on-ramp, by Brian Goetz, Java language architect at Oracle. Gavin Bierman, consulting member of technical staff at Oracle, has published the first draft of the specification document for review by the Java community. More details on JEP 445 may be found in this InfoQ news story. The review is expected to conclude on November 13, 2024.

JEP 494, Module Import Declarations (Second Preview), has been promoted from Candidate to Proposed to Target for JDK 24. This JEP proposes a second preview after the first round of preview, namely: JEP 476, Module Import Declarations (Preview), delivered in JDK 23. This feature will enhance the Java programming language with the ability to succinctly import all of the packages exported by a module with a goal to simplify the reuse of modular libraries without requiring to import code to be in a module itself. Changes from the first preview include: remove the restriction that a module is not allowed to declare transitive dependencies on the java.base module; revise the declaration of the java.se module to transitively require the java.base module; and allow type-import-on-demand declarations to shadow module import declarations. These changes mean that importing the java.se module will import the entire Java SE API on demand. The review is expected to conclude on November 13, 2024.

JEP 492, Flexible Constructor Bodies (Third Preview), has been promoted from Candidate to Proposed to Target for JDK 24. This JEP proposes a third round of preview, with minimal change to gain additional experience and feedback from the previous two round, namely: 482, Flexible Constructor Bodies (Second Preview), delivered in JDK 23; and JEP 447, Statements before super(...) (Preview), delivered in JDK 22. This feature allows statements that do not reference an instance being created to appear before the this() or super() calls in a constructor; and preserve existing safety and initialization guarantees for constructors. Changes in this JEP include: a treatment of local classes; and a relaxation of the restriction that fields can not be accessed before an explicit constructor invocation to a requirement that fields can not be read before an explicit constructor invocation. Gavin Bierman, Consulting Member of Technical Staff at Oracle, has provided an initial specification of this JEP for the Java community to review and provide feedback. The review is expected to conclude on November 14, 2024.

JEP 483, Ahead-of-Time Class Loading & Linking, has been promoted from Candidate to Proposed to Target for JDK 24. This JEP proposes to "improve startup time by making the classes of an application instantly available, in a loaded and linked state, when the HotSpot Java Virtual Machine starts." This may be achieved by monitoring the application during one run and storing the loaded and linked forms of all classes in a cache for use in subsequent runs. This feature will lay a foundation for future improvements to both startup and warmup time. The review is expected to conclude on November 14, 2024.

JEP 479, Remove the Windows 32-bit x86 Port, has been promoted from Candidate to Proposed to Target for JDK 24. This JEP proposes to fully remove the Windows 32-bit x86 port following its deprecation as described in JEP 449, Deprecate the Windows 32-bit x86 Port for Removal, delivered in JDK 21. The goals are to: remove all code paths in the code base that apply only to Windows 32-bit; cease all testing and development efforts targeting the Windows 32-bit platform; and simplify OpenJDK's build and test infrastructure, aligning with current computing standards. The review is expected to conclude on November 12, 2024.

New JEP Candidates

JEP 497, Quantum-Resistant Module-Lattice-Based Digital Signature Algorithm, has been promoted from its JEP Draft 8339010 to Candidate status. This JEP proposes to "enhance the security of Java applications by providing an implementation of the quantum-resistant Module-Lattice-Based Digital Signature Algorithm (ML-DSA)" as standardized by FIPS 204. This will be accomplished by implementing the Java KeyPairGenerator, Signature and KeyFactory classes.

JEP 496, Quantum-Resistant Module-Lattice-Based Key Encapsulation Mechanism, has been promoted from its JEP Draft 8339009 to Candidate status. This JEP proposes to "enhance the security of Java applications by providing an implementation of the quantum-resistant Module-Lattice-Based Key-Encapsulation Mechanism (ML-KEM)" as standardized by FIPS 203. This will be accomplished by implementing the Java KeyPairGenerator, KEM and KeyFactory classes.

JDK 24 Feature Set (So Far) and Release Schedule

The JDK 24 release schedule, as approved by Mark Reinhold, Chief Architect, Java Platform Group at Oracle, is as follows:

  • Rampdown Phase One (fork from main line): December 5, 2024
  • Rampdown Phase Two: January 16, 2025
  • Initial Release Candidate: February 6, 2025
  • Final Release Candidate: February 20, 2025
  • General Availability: March 18, 2025

With just over a month before the scheduled Rampdown Phase One, where the feature set for JDK 24 will be frozen, these are the 19 JEPs (including the ones that are Proposed to Target) included in the feature set so far:

It is interesting to note that the number of features for JDK 24 has already surpassed the high of 17 features delivered in JDK 16 and JDK 11. For JDK 24, developers are encouraged to report bugs via the Java Bug Database.

About the Author

Rate this Article

Adoption
Style

BT