commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne" <scolebou...@btopenworld.com>
Subject Re: [collections] ReferenceMap changed for WeakIdentityMap but now broken
Date Wed, 24 Mar 2004 06:09:30 GMT
The put(key, value) calls the superclass, which then calls createEntry() to
create an entry. The entry should be of the subclass ReferenceEntry which
should handle the references in the constructor.

Stephen

----- Original Message -----
From: "Noel J. Bergman" <noel@devtech.com>
> I only spent a minute or two looking, but:
>
>     public Object put(Object key, Object value) {
>         if (key == null) {
>             throw new NullPointerException("null keys not allowed");
>         }
>         if (value == null) {
>             throw new NullPointerException("null values not allowed");
>         }
>
>         purge();
>         return super.put(key, value);
>     }
>
> Where exactly does the Reference aspect come into that?  Compare that to
the
> original code.
>
> --- Noel
>
> -----Original Message-----
> From: Stephen Colebourne [mailto:scolebourne@btopenworld.com]
> Sent: Tuesday, March 23, 2004 18:02
> To: Jakarta Commons Developers List
> Subject: [collections] ReferenceMap changed for WeakIdentityMap but now
> broken
>
>
> I altered ReferenceMap to extend AbstractHashedMap, which seems to be
> possible to do in a backwards compatable way (prior to looking at
crreating
> a WeakIdentityMap as per recent requests). The new version is attached.
>
> However, the new version doesn't seem to work, as in the 'reference'
> (weak/soft) aspect seems to have got broken in my changes. (The test cases
> suceed on the old code, but fail on the new code, including the commented
> out test cases)
>
>  I can't spot the problem, so I'm posting it in case someone else wants to
> take a look and tell me my stupid mistake ;-)
>
> Stephen
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message