[freenet-dev] Classpath vs. Sun-Java diffs
Michael Rogers
m.rogers at cs.ucl.ac.uk
Mon Apr 14 08:46:09 UTC 2008
On Apr 14 2008, Daniel Cheng wrote:
>Check http://java.sun.com/j2se/1.4.2/docs/api/java/util/Hashtable.html .
>: The Enumerations returned by Hashtable's keys and values methods are
>not fail-fast.
Thanks!
>Hashtable is for JDK1.1 compatibility. new code should use other
>java.util.Map instead.
Not necessarily - Hashtable is threadsafe IIRC but HashMap isn't (likewise
for Vector vs ArrayList, etc).
Anyway, the point is that we shouldn't be modifying a collection while
iterating over it, and we can't depend on the JVM to notice - are there any
other places in the code where this happens?
Cheers,
Michael
More information about the Devl
mailing list