How New Java Features are Released ?

About

New Java features are introduced through a structured and well-defined process to ensure they are robust, well-designed, and meet the needs of the Java community. This process involves multiple stages, from conception to standardization.

Stages

1. Proposal and Drafting

  • JEP (JDK Enhancement Proposal): The introduction of a new feature usually begins with a JEP. A JEP is a document that describes the feature, its motivation, its design, and how it will be implemented. The JEP process ensures that every new feature is thoroughly considered and documented before development begins.

  • Community Input: The JEP is discussed within the Java community, including developers, experts, and stakeholders. This helps refine the idea and gather initial feedback.

2. Incubation (Optional)

  • Incubator Modules: For very experimental features or APIs, the Java platform may use incubator modules. These are meant for features that are not yet ready for even a preview release. Incubation allows for experimentation and feedback without committing to any particular design.

  • Feedback Collection: During this phase, developers can use the experimental feature and provide feedback on its design and usability.

3. Preview Releases

  • First Preview: Once a feature is deemed stable enough, it may be released as a preview feature in a specific Java version. This means it is included in the JDK but is not yet part of the standard Java SE. Preview features need to be explicitly enabled by the developer using command-line flags.

  • Feedback and Refinement: Developers use the preview feature and provide feedback. The feature may undergo changes based on this feedback.

  • Subsequent Previews: If significant changes are needed, the feature may be released again as a second, third, etc., preview in subsequent Java versions. Each iteration allows for further refinement and testing.

Preview Features

Preview features are new features that are included in a Java release to allow developers to try them out and provide feedback. These features are not yet finalized and may undergo changes based on the feedback received. They are meant to be used in development and testing environments, not in production.

Second Preview, Third Preview, etc.

When a feature is released as a preview and then subsequently revised based on user feedback and further testing, it may be re-released in the next version of Java as a "Second Preview," "Third Preview," and so on. Each preview iteration allows the feature to be refined and adjusted, ensuring that it meets the needs and expectations of the Java community.

4. Finalization and Standardization

  • Finalization: After one or more preview iterations, if the feature is considered stable and meets the necessary criteria, it is finalized. The design is frozen, and the feature is prepared for standardization.

  • Standardization: The feature is then included as a permanent part of the Java language or platform in a future release. It becomes part of the standard Java SE and is enabled by default.

5. Release and Adoption

  • Official Release: The finalized feature is included in an official Java release. It becomes available to all Java developers as part of the standard JDK.

  • Adoption: Developers start using the new feature in production environments. The Java community continues to provide feedback, which helps in identifying any remaining issues or areas for improvement.

Key Stages and Their Benefits

  1. Proposal and Drafting: Ensures new features are well-documented and thought out before development starts.

  2. Incubation: Allows for experimental features to be tested and refined without commitment.

  3. Preview Releases: Provides a feedback loop with the developer community, ensuring the feature meets real-world needs.

  4. Finalization and Standardization: Ensures the feature is stable and robust before becoming part of the standard platform.

  5. Release and Adoption: Encourages widespread use and further feedback to continue improving the feature.

Example of a New Feature Introduction

Consider the introduction of the Pattern Matching for instanceof feature:

  1. JEP Creation: A JEP is created to propose pattern matching for the instanceof operator, detailing its design and motivation.

  2. Preview Release: The feature is included as a preview in Java 14, requiring a special flag to enable.

  3. Feedback and Iteration: Based on developer feedback, the feature is refined and re-released as a second preview in Java 15 and then further refined in subsequent releases.

  4. Finalization: After multiple iterations, the feature is finalized.

  5. Standardization: The feature is included as a standard part of the Java language in a later release (e.g., Java 16 or 17).

This structured approach helps maintain the quality and stability of the Java platform while allowing it to evolve and incorporate new features that address the needs of its vast user base.

Last updated