payamrastogi / kryo

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

Kryo gets ClassCastException when deserializing TreeSet with Comparator #139

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
serialize this after uncommenting the 2 lines mentioning Kryo.
1. Kryo refuses to serialize inner class if not static
2. Kryo gets ClassCast Exception when deserializing TreeSet 

http://code.google.com/p/fast-serialization/source/browse/trunk/src/test/java/de
/ruedigermoeller/serialization/testclasses/basicstuff/CommonCollections.java

What version of the Kryo are you using?
2.2.2

Original issue reported on code.google.com by moru0...@gmail.com on 8 Oct 2013 at 11:13

GoogleCodeExporter commented 9 years ago
> 1. Kryo refuses to serialize inner class if not static

Use "kryo.setInstantiatorStrategy(new StdInstantiatorStrategy());" as a fix.

> 2. Kryo gets ClassCast Exception when deserializing TreeSet 

AFAICS we need a TreeSetSerializer for this.

Original comment by martin.grotzke on 9 Oct 2013 at 9:41

GoogleCodeExporter commented 9 years ago
Fixed in trunk.

@moru0011: Do you need this to be released soon (to maven central)?

Original comment by martin.grotzke on 11 Oct 2013 at 9:56

GoogleCodeExporter commented 9 years ago
No, as said I use kryo for benchmarking only, i just wanted to help improving. 

Original comment by moru0...@gmail.com on 11 Oct 2013 at 10:09

GoogleCodeExporter commented 9 years ago
Alright, thanx for reporting!

Original comment by martin.grotzke on 11 Oct 2013 at 10:16