magro / kryo-serializers

More kryo serializers
Apache License 2.0
381 stars 120 forks source link

missing Collections.nCopies serializer #56

Closed lbergelson closed 8 years ago

lbergelson commented 8 years ago

Would it be possible to add a Serializer for the CopiesList class that's returned by Collections.nCopies()?

One exists already here but it would be convenient if it was included in this package.

magro commented 8 years ago

Such a serializer could also go into kryo core since Collections.nCopies belongs to the jdk. Just submit a pull request there :-)

lbergelson commented 8 years ago

Ah, good point.

akiezun commented 8 years ago

how is that different from CollectionsSingletonListSerializer - for lists created via Collections#singletonList(Object)? why is that one here and nCopies would be in core kryo?

magro commented 8 years ago

The difference is that I initially wrote the CollectionsSingletonListSerializer as part of this addon project, later it was added to kryo core (see DefaultSerializers). At some point we came to the conclusion that kryo can provide any serializer for jdk classes, and serializers for 3rd party libs should go into kryo-serializers. So today CollectionsSingletonListSerializer would be added to kryo directly :-)

In kryo-serializers there's still #17 open to remove obsolete serializers. Few other serializers can also be moved to kryo, this is tracked by EsotericSoftware/kryo#151.