[lworld] RFR: 8281295: Prototype serialization/deserialization using Unsafe. [v6]
Mandy Chung
mchung at openjdk.org
Fri Oct 14 16:07:21 UTC 2022
On Fri, 14 Oct 2022 13:45:41 GMT, Roger Riggs <rriggs at openjdk.org> wrote:
>> Specify serialization and deserialization of value objects. Value objects are immutable, Externalizable relies on mutation, Externalizable is not supported for value objects. Revised tests and added tests for graphs of value objects.
>>
>> Somewhat similar to Record serialization in that back references to the value object store 'null' until the value object is completely deserialized.
>> Similar to regular serialization/deserialization of identity objects. The serialized form is the same.
>> Deserialization is done by reading fields and storing into a Buffered larval object, converted to a value object when all of the fields have been read and stored.
>>
>> Externalizable and Value Objects are incompatible, value objects are immutable and Externalizable.readExternal is expected to modify the fields of an allocated object.
>
> Roger Riggs has updated the pull request incrementally with one additional commit since the last revision:
>
> Revert Q type changes, value types (aka primitive classes) are not fully supported
This looks good as an initial prototype.
src/java.base/share/classes/java/io/ObjectOutputStream.java line 136:
> 134: * object such as a record.
> 135: *
> 136: * Value objects cannot be `java.io.Externalizable`.
Suggestion:
* Value objects cannot be {@code java.io.Externalizable}.
-------------
Marked as reviewed by mchung (Committer).
PR: https://git.openjdk.org/valhalla/pull/761
More information about the valhalla-dev
mailing list