Avi-Levi / kryo

Automatically exported from code.google.com/p/kryo
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Collections/Map/Array references at not handled by the ReferenceFieldSerializer #38

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.When 2 objects reference the same collection/map/array and you make a 
roundtrip (serialize/deserialize), you end up with 2 collections/map/array 
instead of the same ones in each object.

What is the expected output? What do you see instead?
Serializing the same collection should result in only one collection after 
deserialization. Right now I end up with 2 collections. I understand the the 
ReferenceFieldSerializer is not intended to handle this case, because 
Collections/Map/Array are handled by other serializers so I made some 
modifications to the code to be able to handle this case with a decorator. If 
you want to integrate it to kryo, feel free to, or maybe you have a better 
approch to propose.

What version of the Kryo are you using?
1.04

Please provide any additional information below.
Attached is a patch for the modifications and a jUnit test for the case.

Original issue reported on code.google.com by mathieu....@gmail.com on 2 Mar 2011 at 10:32

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by nathan.s...@gmail.com on 29 Mar 2012 at 6:29

GoogleCodeExporter commented 9 years ago
Fixed in Kryo v2, now in trunk.

Original comment by nathan.s...@gmail.com on 1 Apr 2012 at 7:45