RFR: 8330276: Console methods with explicit Locale [v2]

Roger Riggs rriggs at openjdk.org
Wed May 1 17:13:53 UTC 2024


On Mon, 29 Apr 2024 23:22:21 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.
>
> Naoto Sato has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Addressed review comments

src/java.base/share/classes/java/io/ProxyingConsole.java line 89:

> 87:     @Override
> 88:     public Console format(String format, Object ... args) {
> 89:         return format(Locale.getDefault(Locale.Category.FORMAT), format, args);

Given the number of calls to Locale.getDefault(Locale.Category.FORMAT) it might be worthwhile to cache that in the Proxying Console or in the JdkConsoleImpl.

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

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


More information about the core-libs-dev mailing list