Re: bug in BinaryDeserializer?
| Newsgroups | gmane.comp.java.sisc.devel |
|---|---|
| Message-ID | <[email protected]> |
> contains null. > > Adding some tracing to the (de)serialization reveals that the hashtable > and contained JavaObjects get serialized correctly. However on hashtable > deserialization the key object returned from the serializer is a > a non-initialized JavaObject. This happens because the JavaObject in > question is not shared, i.e. it's of serialization type 0. > BinaryDeserializer.readExpression in that case doesn't read the object > immediately and instead just queues a read job. > > Normally this doesn't make any difference, because the object content > does get deserialized eventually and deserialization methods generally > do not look at the content of objects. However, the latter is not true > in case of hashtables since inserting the hashtable entries requires > access to the contents of the key. > > Is this a bug in the (de)serialization code or is this behaviour expected? As you say, ordinarily the deserialization methods don't need to look at the contents of a deserialized object right away. This is an exception, so it suggests we need a way to specify that we need the object fully initialized during deserialization, (and thus we need to serialize it so that can happen). Since its a JavaObject, we probably actually want the ser/deser methods or the contract of JavaObject to hint to the serialization that this needs to be enforced.
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE+rTm5r9IW4v3mHtQRAo43AJ9mrOnGRTuWyAs7Q4ePBEenbb+NrgCfdZ3z m1Ueu3Hu/+D4mN9ttFwOxNE= =+zW1 -----END PGP SIGNATURE-----