RFR: 8340830: Console.readLine() and Console.printf() are mutually blocking [v2]

Naoto Sato naoto at openjdk.org
Fri Jan 30 16:54:08 UTC 2026


On Fri, 30 Jan 2026 12:37:08 GMT, Per Minborg <pminborg at openjdk.org> wrote:

>> Naoto Sato has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Made ProxyingConsole value-based, used anonymous class for LazyConstant
>>  - Refine exceptions
>
> src/java.base/share/classes/java/io/ProxyingConsole.java line 37:
> 
>> 35:  * provided with jdk.internal.io.JdkConsoleProvider.
>> 36:  */
>> 37: final class ProxyingConsole extends Console {
> 
> Would it make sense to make all the classes in this file records and/or value classes, as all the fields are `final`?

Right, I annotated the class with `@ValueBased`, as it has to extend `Console` class.

> src/java.base/share/classes/java/io/ProxyingConsole.java line 53:
> 
>> 51:     @Override
>> 52:     public PrintWriter writer() {
>> 53:         PrintWriter printWriter = this.printWriter;
> 
> So nice to get rid of such code segments!

Yes! It's a bliss

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29493#discussion_r2747132900
PR Review Comment: https://git.openjdk.org/jdk/pull/29493#discussion_r2747134487


More information about the core-libs-dev mailing list