On Mon, 5 Dec 2022 19:52:59 GMT, Naoto Sato <na...@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: > > Fixed the copyright year src/java.base/share/classes/java/io/Console.java line 616: > 614: JdkConsoleProvider.DEFAULT_PROVIDER_MODULE_NAME); > 615: return > ServiceLoader.load(JdkConsoleProvider.class).stream() > 616: .map(ServiceLoader.Provider::get) Furthermore, I think in its current form it means that this will load/instantiate any `JdkConsoleProvider` implementations that are accessible to the thread context classloader but may not have been from the module configured through `jdk.console` system property. That could potentially mean, in the best case, unnecessary classloading of additional classes and in the worst case, could result in `ServiceLoader.Provider::get` throwing a `ServiceConfigurationError` error for any of such unused provider implementations, thus forcing us to use `java.io.Console` instance. ------------- PR: https://git.openjdk.org/jdk/pull/11421