Thanks Phil, that was the problem. ReferenceMap now extends
AbstractHashedMap ;-)
Stephen

----- Original Message -----
From: "Phil Steitz" <[EMAIL PROTECTED]>
> I think the problem may be in the first line below.  I don't think you
> want to hash the reference.  If you change hash(ref) to ref.hashCode() all
> tests (including commented out ones) succeed.
>
> >
> >     private void purge(Reference ref) {
> >         // The hashCode of the reference is the hashCode of the
> >         // mapping key, even if the reference refers to the
> >         // mapping value...
> >         int hash = hash(ref);
> >         int index = hashIndex(hash, data.length);
> >         HashEntry previous = null;
> >         HashEntry entry = data[index];
> >         while (entry != null) {
> >             if (((ReferenceEntry) entry).purge(ref)) {
> >                 if (previous == null) {
> >                     data[index] = entry.next;
> >                 } else {
> >                     previous.next = entry.next;
> >                 }
> >                 this.size--;
> >                 return;
> >             }
> >             previous = entry;
> >             entry = entry.next;
> >         }
> >
> >     }
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to