Hi,
I'm using Kryo 5.1.1 on JDK 16.0.2.
I am struggling to serialize records whose fields are not of a concrete type.
Please find attached a simple example. It declares a record with a field of type java.lang.Number, and constructs an instance of this using an Integer. Attempting to serialize the record fails with "Class is not registered: java.lang.Number" (registering java.lang.Number obviously doesn't help).
It works fine if the record's field is declared as a concrete type such as int or Integer. A regular class with a field of type Number also works fine.
Note that I am seeing this behaviour with fields of any interface type - java.lang.Number is just an example. I first ran into this after converting an existing class to a record which has a field of type java.util.Set.
Am I missing something? Any help would be appreciated.
Thanks
Stu