Sent: Wednesday, December 9, 2015 12:22
To: Jaromir Hamala
Cc: core-libs-dev@openjdk.java.net
Subject: Re: ConcurrentMap::compute clarification
Hi Jaromir,
Thanks, you found a bug, seems to be a hangover from the Map default
implementation.
One fix might be:
if (oldValue != null
Hi Paul,
many thanks for confirmation. I'm going to fill the bug.
Cheers,
Jaromir
On Wed, Dec 9, 2015 at 1:21 PM, Paul Sandoz wrote:
> Hi Jaromir,
>
> Thanks, you found a bug, seems to be a hangover from the Map default
> implementation.
>
> One fix might be:
>
> if (oldValue != null) {
>
Hi Jaromir,
Thanks, you found a bug, seems to be a hangover from the Map default
implementation.
One fix might be:
if (oldValue != null) {
// something to remove
if (remove(key, oldValue)) {
// removed the old value as expected
return null;
}
// some other value