RE: ConcurrentMap::compute clarification

2015-12-09 Thread Timo Kinnunen
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

Re: ConcurrentMap::compute clarification

2015-12-09 Thread Jaromir Hamala
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) { >

Re: ConcurrentMap::compute clarification

2015-12-09 Thread Paul Sandoz
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