On Fri, 8 Mar 2024 23:18:37 GMT, Weijun Wang <wei...@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

Reply via email to