RFR: 8247402: rewrite the implementation requirements for Map::compute()
Pavel Rappo
prappo at openjdk.java.net
Tue Oct 13 13:38:16 UTC 2020
On Tue, 13 Oct 2020 09:30:51 GMT, Pavel Rappo <prappo at openjdk.org> wrote:
>> This is from the mailing list: http://mail.openjdk.java.net/pipermail/core-libs-dev/2020-June/067213.html
>
> The proposed implementation behaves differently from the existing implementation in the case of `null` value. That is,
> when `map.containsKey(key) == true && map.get(key) == null`. The difference is that the proposed implementation will
> remove the `(key, null)` mapping if `newValue == null`, whereas the existing implementation will not.
Perhaps I should clarify my previous comment. When I said "implementation" what I meant was that pseudo-code inside the
`@implSpec` tag, not the actual body of `default V compute(K key, BiFunction<? super K, ? super V, ? extends V>
remappingFunction)`.
-------------
PR: https://git.openjdk.java.net/jdk/pull/451
More information about the core-libs-dev
mailing list