« Return to Thread: 2.8 collections

Re: 2.8 collections

by Michael Nascimento :: Rate this Message:

Reply to Author | View in Thread

On Mon, May 18, 2009 at 11:24 PM, Ben Jackman
<benjamin.jackman@...> wrote:
>
> I had a few thoughts concerning some things on page 15, It's kind of long so
> I posted it to my blog, generally I am concerned about the mutable
> collections throwing UnsupportedOperationException when their hashCode
> method is called. (It violates the equals/hashCode contract and could be a
> nasty gotcha)
>
> http://scalide.blogspot.com/2009/05/hashcode-equals-in-scala-28-collections.html

In general, I agree with it. Making hashCode throw an exception breaks
the equals/hashCode contract and sounds like a bad idea.

Regards,
Michael

 « Return to Thread: 2.8 collections