RFR: 8357995: Use "stdin.encoding" for reading System.in with InputStreamReader/Scanner [core] [v5]

Volkan Yazici vyazici at openjdk.org
Wed Jun 11 10:43:48 UTC 2025


On Wed, 11 Jun 2025 10:29:52 GMT, Volkan Yazici <vyazici at openjdk.org> wrote:

>> Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Improve code style
>>   
>>   Co-authored-by: Andrey Turbanov <turbanoff at gmail.com>
>
> test/jdk/javax/script/MyContext.java line 52:
> 
>> 50:         engineScope = new SimpleBindings();
>> 51:         globalScope = null;
>> 52:         reader = new InputStreamReader(System.in, System.getProperty("stdin.encoding"));
> 
> I will revert this change, since
> 
> 1. AFAICT, this file is not used anymore
> 2. Neither `std{out,err}.encoding` were used while creating `PrintWriter`s below

Reverted in ca96e12be8e.

> test/jdk/javax/security/auth/login/LoginContext/DefaultHandlerImpl.java line 80:
> 
>> 78:                 System.err.flush();
>> 79:                 Reader stdinReader = new InputStreamReader(System.in, System.getProperty("stdin.encoding"));
>> 80:                 nc.setName(new BufferedReader(stdinReader).readLine());
> 
> Will revert this change, it is superfluous. As a matter of fact, there is a `readPassword(System.in)` down below that could have also been addressed.

Reverted in ca96e12be8e.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25544#discussion_r2139804910
PR Review Comment: https://git.openjdk.org/jdk/pull/25544#discussion_r2139804751


More information about the core-libs-dev mailing list