You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I work on the JDK, and I’m curious if you are planning to support record types in JDK 14? If so, I’d be happy to help.
From a runtime reflection point of view, Java 14 added two specific methods to support records:
Class::isRecord
Class::getRecordComponents (and its j.l.r.RecordComponent type)
It is with these two primitives that the whole Java Serializable record support is built upon.
On the serializing side, a record's accessors can be used to extract the values of its components . On the deserializing side, the only way to instantiate the record object is to invoke the record's canonical constructor, which is passed the appropriate component values.
It is worth noting that starting in Java 15, core reflection will no longer be able to mutate the component fields of a record object. Construction should proceed through the canonical constructor.
Again, I'd love to to help to make XStream work out-of-the-box with records, so let me know if there is anything I can contribute.
The text was updated successfully, but these errors were encountered:
Hi,
I work on the JDK, and I’m curious if you are planning to support record types in JDK 14? If so, I’d be happy to help.
From a runtime reflection point of view, Java 14 added two specific methods to support records:
It is with these two primitives that the whole Java Serializable record support is built upon.
On the serializing side, a record's accessors can be used to extract the values of its components . On the deserializing side, the only way to instantiate the record object is to invoke the record's canonical constructor, which is passed the appropriate component values.
It is worth noting that starting in Java 15, core reflection will no longer be able to mutate the component fields of a record object. Construction should proceed through the canonical constructor.
Again, I'd love to to help to make XStream work out-of-the-box with records, so let me know if there is anything I can contribute.
The text was updated successfully, but these errors were encountered: