Actually the more I thought about it, putIfAbsent() can work with maps that 
allows nulls. Turns out the ConcurrentMap interface alludes to this and 
doesn't mandate a return value of null to mean there was no existing 
mapping. Perhaps the reason has more to do with the internals of CHM where 
entry values that are null indicate the need to retry the read. Even given 
that I don't see why an internal object representing a "null value" couldn't 
be used here. Anyway, this is kinda OT for this list :-)

> -----Original Message-----
> From: tc-dev-boun...@lists.terracotta.org [mailto:tc-dev-
> boun...@lists.terracotta.org] On Behalf Of Steve Harris
> Sent: Saturday, January 31, 2009 1:05 PM
> To: tc-dev@lists.terracotta.org
> Subject: Re: [tc-dev] Why are null values illegal in
> ConcurrentStringMap?
>
> You read my mind! I had an e-mail ready to scratch my itch of curiosity
> as to why it was that way. I assumed their had to be a reason. Thanks!
> Cheers,
> Steve
>
> ----- Original Message -----
> From: "Tim Eck" <t...@terracottatech.com>
> To: tc-dev@lists.terracotta.org
> Sent: Sunday, February 1, 2009 12:30:26 AM GMT +05:30 Chennai, Kolkata,
> Mumbai, New Delhi
> Subject: Re: [tc-dev] Why are null values illegal in
> ConcurrentStringMap?
>
>
>
>
>
> In case anyone is curious, I think CHM disallows null values so that
> putIfAbsent() can work efficiently. Hashtable’s restriction is probably
> just because it was written 11 years ago :-)
>
>
>
>
>
>
> From: tc-dev-boun...@lists.terracotta.org [mailto:tc-dev-
> boun...@lists.terracotta.org] On Behalf Of Tim Eck
> Sent: Saturday, January 31, 2009 10:21 AM
> To: tc-dev@lists.terracotta.org
> Subject: Re: [tc-dev] Why are null values illegal in
> ConcurrentStringMap?
>
>
>
> CHM and Hashtable don’t allow null values either :-)
>
>
>
>
>
>
> From: tc-dev-boun...@lists.terracotta.org [mailto:tc-dev-
> boun...@lists.terracotta.org] On Behalf Of Steven Harris
> Sent: Saturday, January 31, 2009 10:15 AM
> To: tc-dev@lists.terracotta.org
> Subject: Re: [tc-dev] Why are null values illegal in
> ConcurrentStringMap?
>
>
>
> That would be simple but I'm not talking about keys I'm talking about
> values :-)
>
>
>
>
>
>
>
>
> Cheers,
>
>
> Steve Harris
>
>
>
> "Terracotta. It's ten pounds of awesome in a five pound sack. "
>
>
>
>
>
>
>
>
>
>
>
>
> On Jan 31, 2009, at 11:40 PM, Geert Bevin wrote:
>
>
>
>
> Very simply, neither Hashtable nor ConcurrentHashMap allow null keys
> and the first one is backing the DSO version of CSM and the second one
> the non DSO version.
>
> Take care,
>
> Geert
>
> On 31 Jan 2009, at 15:33, Steven Harris wrote:
>
>
>
> Just curious. Clearly an explicitly decision, probably a good reason
>
>
>
> but I don't recall what it is?
>
>
>
>
>
>
>
> Cheers,
>
>
>
> Steve Harris
>
>
>
> "Terracotta. It's ten pounds of awesome in a five pound sack."
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
>
>
>
> tc-dev mailing list
>
>
>
> tc-dev@lists.terracotta.org
>
>
>
> http://lists.terracotta.org/mailman/listinfo/tc-dev
>
>
> --
> Geert Bevin
> Terracotta - http://www.terracotta.org
> Uwyn "Use what you need" - http://uwyn.com
> RIFE Java application framework - http://rifers.org
> Flytecase Band - http://flytecase.be
> Music and words - http://gbevin.com
>
> _______________________________________________
> tc-dev mailing list
> tc-dev@lists.terracotta.org
> http://lists.terracotta.org/mailman/listinfo/tc-dev
>
>
> _______________________________________________
> tc-dev mailing list
> tc-dev@lists.terracotta.org
> http://lists.terracotta.org/mailman/listinfo/tc-dev
> _______________________________________________
> tc-dev mailing list
> tc-dev@lists.terracotta.org
> http://lists.terracotta.org/mailman/listinfo/tc-dev
_______________________________________________
tc-dev mailing list
tc-dev@lists.terracotta.org
http://lists.terracotta.org/mailman/listinfo/tc-dev

Reply via email to