Summary
It is proposed to finalise the Compact Source Files and Instance Main Methods JEP in JDK 25.
This JEP contains the following improvements to the fourth preview version that appeared in JDK 24:
- The new
IOclass to be moved from thejava.iopackage to thejava.langpackage. - Change the implementation of the
IOclass so that printing and reading are based onSystem.outandSystem.in, respectively. (In the JDK 24 preview, the methods of theIOclass were thin wrappers around their equivalents in theConsoleclass.) - Compact source files to no longer implicitly import the
staticmethods from theIOclass.
Problem
The current experience with the previous rounds of the Compact Source Files and Instance Main Methods feature suggest the feature can be finalized.
Solution
The Compact Source Files and Instance Main Methods feature, along with the new class java.lang.IO will finalise in JDK 25. Other than the improvements listed above, there are no changes from the fourth preview.
Specification
Draft specification documents are attached here.
The API specdiff is attached as specdiff.00.zip, and is also available for convenience here: https://cr.openjdk.org/~jlahoda/8344706/specdiff.00/overview-summary.html
The --enable-preview flag will no longer be required at compile or run time to use the Compact Source Files, Instance Main Methods or java.lang.IO.
- csr of
-
JDK-8344706 Implement JEP 512: Compact Source Files and Instance Main Methods
-
- Resolved
-
- relates to
-
JDK-8319044 CSR JEP 463: Core Reflection API changes for Implicitly Declared Classes (Second Preview)
-
- Closed
-
-
JDK-8329606 Implement Implicitly Declared Classes and Instance Main Methods (Third Preview)
-
- Closed
-
-
JDK-8341725 Implement Simple Source Files and Instance Main Methods (Fourth Preview)
-
- Closed
-
-
JDK-8342937 Enhance java.io.IO with parameter-less println() and readln()
-
- Closed
-