[Mono-devel-list] Hashtable serialization issue

Lluis Sanchez lluis at ideary.com
Tue Jun 24 13:03:28 EDT 2003


Hi,

There is one problem when serializing a hashtable from which an element has been removed. 

The current implementation uses a special value to mark slots as deleted. It is an Object instance, defined in the constant REMOVED_MARKER. When the hashtable is serialized, it also serializes those Object instances. The problem is that when the hashtable is deserialized, the Object instance that the serializer constructs is not the same as the internal REMOVED_MARKER instance, so it thinks it is valid value slot.

The attached patch solves the problem. However, I don't know if this is the best approach, I don't fully understand why this REMOVED_MARKER is needed.

If there aren't any objections, I'll commit the patch.

Regards,
Lluis.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20030624/8569c445/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Hashtable.diff
Type: application/octet-stream
Size: 856 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20030624/8569c445/attachment.obj 


More information about the Mono-devel-list mailing list