harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sian January" <sianjanu...@googlemail.com>
Subject Re: [classlib] HashMap
Date Fri, 21 Sep 2007 11:02:41 GMT
Hi Rachel,

>From looking at HashMap it looks it depends on the fact that the entries are
instances of HashMap.Entry (i.e. by using the 'next' field), so it's not
just as simple as changing the type to be Map.Entry.  It would require quite
a lot of changes to HashMap so I think it might be easier to fix in
common-chain (e.g. by overriding the writeObject method), unless anyone
thinks that HashMap is designed to be extended in this way, in which case we
should fix it in Harmony.

Thanks,

Sian


On 21/09/2007, Rachel Chen <rechel88@gmail.com> wrote:
>
> Hello,
> I got a exception when I run test common-chain which is also a project
> under
> ASF.
> I found out that is how it happens: We have a interface Map.Entry and
> Class
> MapEntry implements Map.Entry and a inner class of HashMap called Entry
> extends MapEntry. Here comes the problem: a class in common-chain called
> ContextBase extends HashMap and one of its inner classes
> MapEntryImpl implement Map.Entry. When ContextBase call a method
> writeObject in HashMap which has such a clause Entry<?, ?> entry =
> (Entry<?,
> ?>) iterator.next(), stream goes back to ContextBase and returns like this
> Map.Entry entry= ContextBase.this.entry(keys.next())(this one is a
> MapEntryImpl).
> To fix this bug, Can I just simply modify  Entry<?, ?> entry = (Entry<?,
> ?>)
> iterator.next() to Map.Entry<?,?>=(Map.Entry<?, ?>) iterator.next() ?
> Any comments and suggestion? Thank you.
>



-- 
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number
741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message