Open GoogleCodeExporter opened 9 years ago
Hi,
I think I have a solution for it.
I created a code that properly derives which concrete classes are used for
which generic type arguments. I added support for it into MapSerializer and
CollectionSerializer. Seems to work fine for me. And it produces smaller
serialized representations if it can automatically derive that types of keys,
values or elements have a concrete final type.
For example, if you have a class like this:
public class StringMap extends HashMap<String, String> {
}
When you serialize object of this class, no class information will be written
for keys and values. Only the string values.
@Nate: Once you have time and mood to review new patches, please let me know,
and I'll submit a patch for your review.
Original comment by romixlev
on 12 Oct 2012 at 11:47
Please find attached a patch for this problem. Seems to work for me.
Original comment by romixlev
on 24 Oct 2012 at 10:04
Attachments:
The patch seems to work fine, when using the always same constelation of
generics for one class (e.g. Map), but fails when another combination of
generics occurs. This is indicated by the JUnitTests delivered with Kryo. One
of my coworkes fixed it, using your patch. Now, all JUnitTests are working
correctly.
Original comment by mgledi@gmail.com
on 15 Nov 2012 at 5:11
Original issue reported on code.google.com by
mgledi@gmail.com
on 4 Oct 2012 at 12:13