RFR: 8366261: Provide utility methods for sun.security.util.Password [v5]

Naoto Sato naoto at openjdk.org
Thu Sep 4 23:49:28 UTC 2025


On Thu, 4 Sep 2025 23:28:22 GMT, Stuart Marks <smarks at openjdk.org> wrote:

>> Naoto Sato has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Refining comments
>
> src/java.base/share/classes/jdk/internal/io/JdkConsoleImpl.java line 133:
> 
>> 131:                         Charset.forName(StaticProperty.stdinEncoding(), UTF_8.INSTANCE),
>> 132:                         Charset.forName(StaticProperty.stdoutEncoding(), UTF_8.INSTANCE))) :
>> 133:                 Optional.empty();
> 
> (Finally getting back to this.)
> 
> The code returns an Optional containing a JdkConsoleImpl instance, or an empty Optional. However the comment above says it returns a JdkConsoleImpl instance or null. Which do we want it to be? Either is OK, but the comment should agree with the code.
> 
> I think @wangweij might want to weigh in here since his code will be calling this.

Ah, yes. Comment does not align with the code. I am fine either way too.

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

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


More information about the security-dev mailing list