Jeroen> Thanks. I like this change a lot, but I have one small
Jeroen> comment. In the documentation of Map.Entry.hashCode() it is
Jeroen> sort of implied that a null reference returns a 0 hash
Jeroen> code. Both the RI and our current implementation do that, but
Jeroen> this patch changes that.
Thanks for looking at this.
I think we're ok here. Here is the Entry.hashCode change:
Tom> public int hashCode()
Tom> {
Tom> - if (knownMod != modCount || table[loc] == tombstone)
Tom> + if (knownMod != modCount)
Tom> throw new ConcurrentModificationException();
Tom> - return (System.identityHashCode(table[loc])
Tom> - ^ System.identityHashCode(table[loc + 1]));
Tom> + return (System.identityHashCode(unxform(table[loc]))
Tom> + ^ System.identityHashCode(unxform(table[loc + 1])));
Tom> }
unxform maps from the internal form back to the external form.
So we're performing the same computation here that we used to -- if
the user adds a null key or value, null will be used in this
computation.
Tom