RFR: 8356420: Provide examples on wrapping System.in [v6]
Naoto Sato
naoto at openjdk.org
Tue May 13 16:23:55 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.
There are several locations in the jdk source (I simply grep'ed for `new InputStreamReader(System.in)`). And yes, they will need to be replaced with the recommended usage. I will address them with a different JBS issue.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25155#discussion_r2087206716
More information about the core-libs-dev
mailing list