RFR: 8330276: Console methods with explicit Locale

Joe Wang joehw at openjdk.org
Mon Apr 29 22:03:07 UTC 2024


On Tue, 23 Apr 2024 20:35:43 GMT, Naoto Sato <naoto at openjdk.org> wrote:

> Proposing new overloaded methods in `java.io.Console` class that explicitly take a `Locale` argument. Existing methods rely on the default locale, so the users won't be able to format their prompts/outputs in a certain locale explicitly.

src/java.base/share/classes/java/io/Console.java line 193:

> 191:      * {@code locale}.
> 192:      *
> 193:      * @param  locale locale used for formatting

Specify the behavior when locale is null?

src/java.base/share/classes/java/io/Console.java line 202:

> 200:      *         string.  If there are more arguments than format specifiers, the
> 201:      *         extra arguments are ignored.  The number of arguments is
> 202:      *         variable and may be zero.  The maximum number of arguments is

readLine and readPassword don't have this statement (The number of arguments is variable and may be zero). Is this statement helpful for those methods as well?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18923#discussion_r1583826762
PR Review Comment: https://git.openjdk.org/jdk/pull/18923#discussion_r1583828717


More information about the core-libs-dev mailing list