Hi, stumbled on a nasty bug in Clojure. I'm transferring Clojure objects 
around using java serialization. When de-serializing a List 
(clojure.lang.ASeq) it has a hashCode of 0. This means lookups for the 
object in HashMaps PersistentHashMaps HashSets etc fail. The pre-serialized 
version of the object has a valid non-zero hashCode.

The reason for this is that the cached hashCode value is marked as 
transient and its default un-cached value is -1. E.g. if he hashCode is -1 
compute the hashCode. Of course when an Object is de-serialized any integer 
transient fields are set to 0.

This bug seems to be in all Clojure versions.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to