On Thu, 28 Aug 2025 13:41:47 GMT, Chen Liang <li...@openjdk.org> wrote:

>> Naoto Sato has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   @Native annotated
>
> src/java.base/share/classes/jdk/internal/io/JdkConsoleImpl.java line 117:
> 
>> 115:         return INSTANCE.orElseSet(() -> {
>> 116:             // If there's already a proper console, throw an exception
>> 117:             if (System.console() != null) {
> 
> Since this initializes the console, this means the console can only be 
> available when there is no provider and stdin is tty, but stdout is not. Is 
> this intended? (In other words, should we make System.console() lazy, as it 
> is initialized with java.io.Console as Console.cons?)

It would be good to add comments that describes this precondition. We've all 
been discussing it so we "know" what it's doing and why. But other readers, 
like @liach, and future maintainers of the `Password` class, will know what the 
requirements are.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26973#discussion_r2311798748

Reply via email to