RFR: 8298971: Move Console implementation into jdk internal package [v2]
Jaikiran Pai
jpai at openjdk.org
Wed Dec 21 00:35:49 UTC 2022
On Tue, 20 Dec 2022 22:06:26 GMT, Naoto Sato <naoto 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`.
>
> Naoto Sato has updated the pull request incrementally with one additional commit since the last revision:
>
> Removed JdkConsoleProviderImpl, caching INSTANCE
Thank you for these changes Naoto. This version looks much simpler. The changes look good to me.
I'm not knowledgeable in C or JNI code, but in this case it's just moving the existing code from one file to another, so looks good to me.
I've just one minor nit that I've added inline.
src/java.base/share/classes/jdk/internal/io/JdkConsoleImpl.java line 166:
> 164: @Override
> 165: public Charset charset() {
> 166: assert charset != null : "charset() should not return null";
Maybe we could add a `Objects.requireNonNull(charset)` in the constructor of this `JdkConsoleImpl` and remove this `assert`, since `charset` is `final`?
-------------
Marked as reviewed by jpai (Reviewer).
PR: https://git.openjdk.org/jdk/pull/11729
More information about the core-libs-dev
mailing list