-
Notifications
You must be signed in to change notification settings - Fork 843
Closed
Labels
Description
Describe the bug
While testing #847 I noticed that package private records cannot be deserialized.
To Reproduce
static record PackagePrivateRecord(int i, String s) {}
@Test
void testNonPublicRecords() {
kryo.register(PackagePrivateRecord.class);
roundTrip(4, new PackagePrivateRecord(1, "s1"));
}
This fails with:
Caused by: java.lang.NoSuchMethodException: com.esotericsoftware.kryo.serializers.RecordSerializerTest$PackagePrivateRecord.<init>(int,java.lang.String)
at java.base/java.lang.Class.getConstructor0(Class.java:3517)
at java.base/java.lang.Class.getConstructor(Class.java:2238)
at com.esotericsoftware.kryo.serializers.RecordSerializer.invokeCanonicalConstructor(RecordSerializer.java:224)
... 70 more