Make Record serializable again by ibauersachs · Pull Request #242 · dnsjava/dnsjava · GitHub
Skip to content

Make Record serializable again#242

Merged
ibauersachs merged 1 commit into
masterfrom
serializable-record
Jan 23, 2022
Merged

Make Record serializable again#242
ibauersachs merged 1 commit into
masterfrom
serializable-record

Conversation

@ibauersachs

Copy link
Copy Markdown
Member

Instead of relying on the unstable default Java serialization of each
record type, this uses a proxy object. The proxy object only contains
the DNS wire data of a record, which is guaranteed to be stable. This
avoids all concerns about compatibility when Record classes evolve and
with inheritance.

Closes #132
See #114

@codecov-commenter

codecov-commenter commented Dec 26, 2021

Copy link
Copy Markdown

Instead of relying on the unstable default Java serialization of each
record type, this uses a proxy object. The proxy object only contains
the DNS wire data of a record, which is guaranteed to be stable. This
avoids all concerns about compatibility when Record classes evolve and
with inheritance.

Closes #132
See #114
@sonarqubecloud

Copy link
Copy Markdown

@ibauersachs ibauersachs added this to the v3.5 milestone Jan 17, 2022

@nresare nresare left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are fortunate in this project that we happen to have a very battle tested serialisation format for our value objects :)

As an aside, I don't think that the serialisation support in java was ever very well thought out to begin with, but that is not the fault of this change. It is simply magic that adding a non-public non-overriding writeReplace() method changes the serialisation behaviour.

@ibauersachs ibauersachs merged commit bddbb3a into master Jan 23, 2022
@ibauersachs ibauersachs deleted the serializable-record branch January 23, 2022 12:54
ibauersachs added a commit that referenced this pull request Jan 23, 2022
- Serializable updates for #242
- History on GitHub is not so important anymore, move it down
- Update links to RFCs
- Improve doc about the SPI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

org.xbill.DNS.Zone should not implement Serializable

3 participants