RFR: 8356420: Provide examples on wrapping System.in

Brian Burkhalter bpb at openjdk.org
Fri May 9 20:18:56 UTC 2025


On Fri, 9 May 2025 19:53:24 GMT, Naoto Sato <naoto at openjdk.org> wrote:

> With the introduction of `stdin.encoding` ([JDK-8350703](https://bugs.openjdk.org/browse/JDK-8350703)), some guidance for users to decode `System.in` would be desirable. Adding examples in the field description would help.

Looks good.

src/java.base/share/classes/java/lang/System.java line 136:

> 134:      *     new InputStreamReader(System.in, System.getProperty("stdin.encoding"));
> 135:      * }
> 136:      * Or with a {@link java.util.Scanner Scanner}:

"Or with" -> "Using a" or "Or using a" for consistency? Up to you.

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

Marked as reviewed by bpb (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/25155#pullrequestreview-2829563522
PR Review Comment: https://git.openjdk.org/jdk/pull/25155#discussion_r2082436990


More information about the core-libs-dev mailing list