RFR: 8366261: Provide utility methods for sun.security.util.Password [v5]
Weijun Wang
weijun at openjdk.org
Sat Sep 6 01:12:14 UTC 2025
On Thu, 4 Sep 2025 23:37:52 GMT, Naoto Sato <naoto at openjdk.org> wrote:
>> 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.
Either is OK. `Optional` sounds more modern.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26973#discussion_r2326325423
More information about the core-libs-dev
mailing list