RFR: 8344706: Compiler Implementation of Compact Source Files and Instance Main Methods [v3]
Alan Bateman
alanb at openjdk.org
Wed Apr 9 10:24:37 UTC 2025
On Mon, 7 Apr 2025 21:07:36 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:
>> This is a PR that implements JEP: Compact Source Files and Instance Main Methods. Changes include:
>> - `java.io.IO` moved to `java.lang.IO`, and no longer uses `System.console()` to implement the methods (thanks to @stuart-marks)
>> - `java. ... .IO` is no longer automatically imported in any compilation unit
>> - the feature is finalized (i.e. no longer requires `--enable-preview`)
>
> Jan Lahoda has updated the pull request incrementally with one additional commit since the last revision:
>
> Rewrite bits about charset decoding, removing mention of "internal objects."
src/java.base/share/classes/java/lang/IO.java line 47:
> 45: * Decoding may buffer additional bytes beyond those that have been decoded to characters
> 46: * returned to the application. After the first call to one of the {@code readln} methods,
> 47: * any subsequent use of {@code System.in} results in unspecified behavior.
I wonder if we should add a note about mixing API usage into System.in too. There are tutorials and books that show examples build on System.in that will add buffering on that input source.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24438#discussion_r2035067290
More information about the compiler-dev
mailing list