RFR: 8295803: Console should be usable in jshell and other environments [v4]

Andrey Turbanov aturbanov at openjdk.org
Mon Dec 5 07:08:38 UTC 2022


On Sat, 3 Dec 2022 19:18:48 GMT, Naoto Sato <naoto at openjdk.org> wrote:

>> This is to allow Console to be used even when it is not attached to the platform provided terminal, such as the case when the standard input is redirected. `System.console()` now returns a Console implementation based on `jdk.internal.le` terminal by default, or jshell implementation if available. A corresponding CSR has been drafted.
>
> Naoto Sato has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Changed the expected behavior when the SecurityManager is enabled

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

> 60:      */
> 61:     @Override
> 62:     public Console format(String fmt, Object ...args) {

Suggestion:

    public Console format(String fmt, Object ... args) {

src/java.base/share/classes/jdk/internal/io/JdkConsole.java line 40:

> 38:     PrintWriter writer();
> 39:     Reader reader();
> 40:     JdkConsole format(String fmt, Object ...args);

nit
Suggestion:

    JdkConsole format(String fmt, Object ... args);

src/jdk.internal.le/share/classes/jdk/internal/org/jline/JdkConsoleProviderImpl.java line 67:

> 65:         }
> 66: 
> 67:         public synchronized JdkConsole format(String fmt, Object ...args) {

Nit:
Suggestion:

        public synchronized JdkConsole format(String fmt, Object ... args) {

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

PR: https://git.openjdk.org/jdk/pull/11421


More information about the security-dev mailing list