RFR: 8298971: Move Console implementation into jdk internal package

Jaikiran Pai jpai at openjdk.org
Tue Dec 20 14:39:54 UTC 2022


On Tue, 20 Dec 2022 14:17:32 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

>> Moving the built-in implementation of `Console` from `java.io` package into `jdk.internal.io` package. It now implements `JdkConsole` interface and is accessed through `ProxyingConsole`.
>
> src/java.base/share/classes/jdk/internal/io/JdkConsoleImpl.java line 179:
> 
>> 177:     private Writer out;
>> 178:     private PrintWriter pw;
>> 179:     private Formatter formatter;
> 
> Hello Naoto, I think some of these can be made `final`.

Actually, I see that it isn't possible for these to be final because we set these up in the `console(...)` instance method of this class. That's because this `JdkConsoleImpl` implements both the `JdkConsole` interface and the `JdkConsoleProvider` interface.

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

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


More information about the core-libs-dev mailing list