> From: [email protected] [mailto:[email protected]] On Behalf Of 
> Ohad Shacham
> Subject: Re: Atomicity violation in removeAttribute

> I would use:

> if (attributes.containsKey(name)) {
>     value = attributes.remove(name);
>     if (value == null)
>         return;
> }
> else {
>     return;
> }

In what way is that an improvement?  ConcurrentHashMap.remove() returns null 
when the key cannot be found; why add the redundant call to contansKey()?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to