Skip to content

Conversation

ibauersachs
Copy link
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
Copy link

codecov-commenter commented Dec 26, 2021

Codecov Report

Merging #242 (06e2334) into master (4eff203) will increase coverage by 0.02%.
The diff coverage is 76.92%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #242      +/-   ##
============================================
+ Coverage     57.26%   57.29%   +0.02%     
+ Complexity     2088     2087       -1     
============================================
  Files           163      163              
  Lines         10907    10912       +5     
  Branches       1573     1575       +2     
============================================
+ Hits           6246     6252       +6     
+ Misses         4235     4234       -1     
  Partials        426      426              
Impacted Files Coverage Δ
src/main/java/org/xbill/DNS/Record.java 95.77% <76.92%> (-1.00%) ⬇️
src/main/java/org/xbill/DNS/NioClient.java 73.07% <0.00%> (-1.29%) ⬇️
src/main/java/org/xbill/DNS/NioTcpClient.java 68.58% <0.00%> (+3.20%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4eff203...06e2334. Read the comment docs.

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

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

82.4% 82.4% Coverage
0.0% 0.0% Duplication

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

@nresare nresare left a comment

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