[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: DxHashMap can't clone when empty
Yes, but your problem is really over if you:
return super.clone(newMap);
This is virtual method basics !
----- Original Message -----
From: Falko Braeutigam <falko@softwarebuero.de>
To: Ozone DB Mailing List <ozone-users@ozone-db.org>
Sent: Tuesday, February 15, 2000 4:29 PM
Subject: Re: DxHashMap can't clone when empty
> On Tue, 15 Feb 2000, William Uther wrote:
> > Hi all,
> >
> > The title says it all really. On a 1.1 VM DxHashMap.clone() ends up
> > calling new Hashtable(count()) where count() is the number of elements
in
> > the map. However, when count() is 0 this is a bad thing. The following
> > version of clone() works:
> >
> > public Object clone() {
> > int newSize = count();
> > if (newSize < 10)
> > newSize = 10;
> > DxMap newMap = new DxHashMap (newSize);
> > return clone (newMap);
> > }
> Thanks for the fix! On my Alpha, jdk1.2 the 0 size for the hashtable is no
> problem. :|