harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rachel Chen" <reche...@gmail.com>
Subject [classlib] HashMap
Date Fri, 21 Sep 2007 09:49:32 GMT
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.

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