> From: ohad.shac...@gmail.com [mailto:ohad.shac...@gmail.com] 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: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to