JDK-8341725 : Implement Simple Source Files and Instance Main Methods (Fourth Preview)
  • Type: CSR
  • Component: tools
  • Sub-Component: javac
  • Priority: P4
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 24
  • Submitted: 2024-10-08
  • Updated: 2025-04-08
  • Resolved: 2024-10-30
Related Reports
CSR :  
Relates :  
Description
Summary
-------

The Simple Source Files and Instance Main Methods JEP (formerly known as
Implicitly Declared Classes and Instance Main Methods), will re-preview for JDK
24. This JEP, also introduces a simpler way of doing I/O in a program, which is
more aligned with the philosophy of the JEP-to enable a smooth on-ramp to Java
programming. This functionality is currently implemented in the `java.io.IO`
class.

Problem
-------

The Simple Source Files and Instance Main Methods feature depends on module
imports, which is planned to re-preview for JDK 24. Since this JEP introduces
`java.io.IO`, allowing this new class to be tested under real-world conditions
is highly desirable.

As a consequence, we propose to re-preview Simple Source Files and Instance Main
Methods for JDK 24.

Solution
--------

The Simple Source Files and Instance Main Methods feature, and `java.io.IO` will
re-preview for JDK 24. No significant changes are proposed under this CSR, other
than small JLS improvements and clarifications. A separate change(s) to simple
IO may be covered by separate CSR(s).

Specification
-------------

The current draft of the JLS is attached as "Simple Source Files and Instance
main Methods (Fourth Preview) - JLS.pdf", and is also available for convenience
here:
https://cr.openjdk.org/~gbierman/jep495/jep495-20241024/specs/simple-source-files-instance-main-methods-jls.html

The current draft of the JVMS is attached as "Simple Source Files and Instance
main Methods (Fourth Preview) - JVMS.pdf", and is also available for convenience
here:
https://cr.openjdk.org/~gbierman/jep495/jep495-20241024/specs/simple-source-files-instance-main-methods-jvms.html

Comments
Thanks [~jlahoda]; moving to Approved.
30-10-2024

The IO-related changes are covered by JDK-8342936, not other change is planned. It wasn't clear if JDK-8342936 can be done in time to catch JEP -495, so it wasn't added as a subtask yet.
30-10-2024

[~jlahoda] or [~gbierman], please indicate which issues comprise the IO-related change associated with this JEP. Is it just JDK-8342936 or something else? (JDK-8342936 is not listed as a subtask of the JEP.)
30-10-2024

Moving to Provisional, not Approved.
25-10-2024

[~darcy] Draft specs attached.
24-10-2024