RFR: 8327461: KeyStore getEntry is not thread-safe [v6]

Hai-May Chao hchao at openjdk.org
Fri Mar 8 23:32:57 UTC 2024


On Fri, 8 Mar 2024 23:18:37 GMT, Weijun Wang <weijun at openjdk.org> wrote:

>> The API doc states: Returns: the previous value associated with key, or null if there was no mapping for key. It’d be a good practice to check if the entry is not null before proceeding with further operations. Would you please elaborate why it is not needed here?
>
> Because `null` will fail all three `instanceof` checks.

I'd like to keep the check here for good practice and following the API doc, instead of letting further instanceof operation fails. Thanks.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18156#discussion_r1518409894



More information about the security-dev mailing list