RFR: 8247402: rewrite the implementation requirements for Map::compute()

Stuart Marks smarks at openjdk.java.net
Tue Oct 13 16:20:15 UTC 2020


On Tue, 13 Oct 2020 13:35:37 GMT, Pavel Rappo <prappo at openjdk.org> wrote:

>> 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)`.

This change is to a normative portion of the specification, and as such will require a CSR.

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

PR: https://git.openjdk.java.net/jdk/pull/451


More information about the core-libs-dev mailing list