CloudNetService / CloudNet

A modern application that can dynamically and easily deliver Minecraft oriented software
https://cloudnetservice.eu
Apache License 2.0
371 stars 115 forks source link

feat: implement Externalizable for Document #1326

Closed derklaro closed 6 months ago

derklaro commented 10 months ago

Motivation

Externalizable provides a clear api that has to be implemented in order to make an implementation of Document serializable and reduces the risk to fall back to the default jvm behaviour to serialize a document instance.

Modification

Implement Externalizable (which implements Serializable) and implement its api methods. The old serial methods to read and write the object were removed in favor of the new api. A test was also added to ensure the correctness of the implementation.

Result

The document api is less error-prone to serialization issues for future (or user custom) implementations.