Skip to content

kryo-5.2.0

Compare
Choose a tag to compare
@theigl theigl released this 31 Jul 15:22
· 263 commits to master since this release

This is a maintenance release coming with bug fixes and improvements.

#849 Fall back to getDeclaredConstructor for non-public records
#848 Fix #847 Ensure that RecordSerializer can deal with subtypes
#841 Fix #840 Ensure primitive types are assignable to Comparable/Serializables fields
#839 Fix #838 Avoid flush repeatedly when has finished flushing
#829 OSS-Fuzz Integration

The full list of changes can be found here.

Many thanks to all contributors!

Important Upgrade Information

This release fixes two critical issues with the serializer for java.util.Record. One of the issues (#847) seriously limits the serializers practical usefulness, so we decided to make an exception and break serialization compatibility. If you have serialized records with non-final field types that you need to read with Kryo 5.2.0, you can enable backwards compatibility globally or for individual types (recommended):

  1. Register global default serializer:
    final RecordSerializer<?> rs = new RecordSerializer<>();
    rs.setFixedFieldTypes(true);
    kryo.addDefaultSerializer(Record.class, rs);
  1. Register serializer per type:
    final RecordSerializer<?> rs = new RecordSerializer<>();
    rs.setFixedFieldTypes(true);
    kryo.register(MyRecord.class, rs);

For migration from previous major versions please check out the migration guide. We're asking the community to help and contribute this part: please edit the migration wiki page as you encounter any information or issues that might help others.

Compatibility

  • Serialization compatible
    • Standard IO: Yes (except for java.util.Record)
    • Unsafe-based IO: Yes (except for java.util.Record)
  • Binary compatible - Yes (Details)
  • Source compatible - Yes (Details)