They very much can. JEP 500 describes a new API (sun.reflect.ReflectionFactory#defaultReadObjectForSerialization) that gives serialization libraries the same abilities as Java's builtin serialization to initialize an object without calling its constructor. The most important restriction is that the classes being deserialized are required to implement Serializable.
View all comments
Show parent comment
1
u/koflerdavid May 01 '26
They very much can. JEP 500 describes a new API (
sun.reflect.ReflectionFactory#defaultReadObjectForSerialization) that gives serialization libraries the same abilities as Java's builtin serialization to initialize an object without calling its constructor. The most important restriction is that the classes being deserialized are required to implementSerializable.