Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8353437

Compiler Implementation of Compact Source Files and Instance Main Methods

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Unresolved
    • Icon: P4 P4
    • 25
    • tools
    • None
    • source
    • minimal
    • Java API, Language construct
    • SE

      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 IO class to be moved from the java.io package to the java.lang package.
      • Change the implementation of the IO class so that printing and reading are based on System.out and System.in, respectively. (In the JDK 24 preview, the methods of the IO class were thin wrappers around their equivalents in the Console class.)
      • Compact source files to no longer implicitly import the static methods from the IO class.

      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.

      Preliminary specdiff is attached as specdiff.preliminary.00.zip, and is also available for convenience here: https://cr.openjdk.org/~jlahoda/8344706/specdiff.preliminary.00/overview-summary.html

      The --enable-preview flag will no longer be required to at compile or run time to use the Compact Source Files, Instance Main Methods or java.lang.IO.

            jlahoda Jan Lahoda
            gbierman Gavin Bierman
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: