you can use https://github.com/magro/kryo-serializers for this, it
provides several serializers for standard jdk classes, for
Collections.EMPTY_LIST there's the CollectionsEmptyListSerializer.
To register the serializer you have to add
kryo.register( Collections.EMPTY_LIST.getClass(), new
CollectionsEmptyListSerializer() );
Cheers,
Martin
> --
> You received this message because you are subscribed to the "kryo-users"
> group.
> http://groups.google.com/group/kryo-users
--
Martin Grotzke
http://twitter.com/martin_grotzke
Great it works for you,
cheers,
Martin
> --
> You received this message because you are subscribed to the "kryo-users"
> group.
> http://groups.google.com/group/kryo-users
- --
Martin Grotzke
http://twitter.com/martin_grotzke
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
iEYEARECAAYFAk2db/8ACgkQ7FvOl7Te+pZT5ACghWZRNKddMCv1w3ED2clgL9Qp
QOQAnA9kDLpzSNA2zPQtuWNh00TrCcq7
=dkoo
-----END PGP SIGNATURE-----
this error pops up as the ReentrantLock is serialized using FieldSerializer.
You can write a custom serializer for ReentrantLock that correctly
handles this class and register this serializer for ReentrantLock at kryo.
I'd say that this is also a good idea as with the fieldserializer it
might happen that you serialize/deserialize it in a locked state, but
probably you'd expect such stuff to start "fresh" / unlocked when
deserialized.
Often the methods for java serialization (writeObject/readObject) in
such classes show you how to implement the custom serializer.
There's already a project that provides several serializers for standard
jdk types: https://github.com/magro/kryo-serializers
So this might also be a good home for a ReentrantLockSerializer if it
wouldn't make it into kryo itself.
Cheers,
Martin
> --
> You received this message because you are subscribed to the "kryo-users"
> group.
> http://groups.google.com/group/kryo-users
--
Martin Grotzke
http://twitter.com/martin_grotzke