RFR: 8357995: Use "stdin.encoding" for reading System.in with InputStreamReader/Scanner [core] [v3]
Volkan Yazici
vyazici at openjdk.org
Mon Jun 2 19:50:11 UTC 2025
On Mon, 2 Jun 2025 19:27:14 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:
>> Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Clean-up `MultiBreakpointsTarg`
>
> test/jdk/com/sun/jdi/MultiBreakpointsTest.java line 141:
>
>> 139: Thread console(final int num, final int nhits) {
>> 140: final InputStreamReader isr = new InputStreamReader(
>> 141: System.in, Charset.forName(System.getProperty("stdin.encoding")));
>
> `isr` is not really needed. It is used to create `br`, which is never used. It is also synchronized on, but since there is a unique `isr` for each thread, the synchronization does nothing. I suggest just deleting `isr`, `br`, and the `synchronized` below.
>
> Note there is a hint in a comment as to why it is like this:
>
>
> // This is a tendril from the original jdb test.
> // It could probably be deleted.
>
>
> I think this test once used jdb (and had to deal with the jdb console), but no longer does.
Implemented your suggestion in 8f8a65754 – took the liberty to remove the unused `done` too.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25544#discussion_r2122019203
More information about the serviceability-dev
mailing list