RFR: 8356420: Provide examples on wrapping System.in [v6]
Volkan Yazici
vyazici at openjdk.org
Tue May 13 19:14:52 UTC 2025
On Tue, 13 May 2025 12:34:01 GMT, Chen Liang <liach at openjdk.org> wrote:
>> src/java.base/share/classes/java/io/InputStreamReader.java line 59:
>>
>>> 57: * new InputStreamReader(System.in, System.getProperty("stdin.encoding"));
>>> 58: * }
>>> 59: *
>>
>> There are several places in the sources that still contain `new InputStreamReader(System.in)`. Shouldn't they be replaced with `new InputStreamReader(System.in, System.getProperty("stdin.encoding"))` too?)
>
> How did you search for those sources? I searched for literal `System.in` and my comments are the only ones I could find in the JDK.
@liach, regex already reveals some, after tweaking it enough to eliminate false positives. 😅 `CTRL+Click`'ing on `InputStreamReader::new(InputStream)` gives an exhaustive list short enough to skim through.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25155#discussion_r2087471334
More information about the core-libs-dev
mailing list