RFR: 8344706: Compiler Implementation of Compact Source Files and Instance Main Methods [v5]

Tatsunori Uchino duke at openjdk.org
Sun Apr 27 09:15:48 UTC 2025


On Tue, 22 Apr 2025 12:39:05 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 seven additional commits since the last revision:
> 
>  - Merge remote-tracking branch 'origin/finalize-concise-source-files' into finalize-concise-source-files
>  - Reverting test commit.
>    
>    This reverts commit 7047cf007cc7de937aa21e96125083ee92932692.
>  - Fixing tests.
>  - Updating copyright year.
>  - Adding bug number to tests.
>  - Fixing IO tests path
>  - Scratch

src/java.base/share/classes/java/lang/IO.java line 192:

> 190:             String enc = System.getProperty("stdin.encoding", "");
> 191:             Charset cs = Charset.forName(enc, StandardCharsets.UTF_8);
> 192:             br = new BufferedReader(new InputStreamReader(System.in, cs));

I suspect we need to fall back to `stdout.encoding` first before UTF-8 especially for Windows if Java does not set it automatically when launched.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/24438#discussion_r2062571907


More information about the compiler-dev mailing list