Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getAddress() in ARecord/AAAARecord should return Inet4Address/Inet6Address #101

Open
maffe opened this issue Apr 28, 2020 · 1 comment
Open
Milestone

Comments

@maffe
Copy link

maffe commented Apr 28, 2020

To avoid having to cast in client code,

  • ARecord.getAddress() should return Inet4Address
  • AAAARecord.getAddress() should return Inet6Address

I tried to change the return type (adding casts inside the method), but then I got

Failed to execute goal com.github.siom79.japicmp:japicmp-maven-plugin:0.14.0:cmp (check-compatibility) on project dnsjava: Versions of archives indicate a minor change but binary incompatible changes found.

While this changes the public API, usages of those methods should work like before, as the new return types can still be assigned to InetAddress. What could fail with this change is overriding those methods. Maybe the methods or the classes should be final.

@ibauersachs
Copy link
Member

Unfortunately apicmp is right. While the change is source compatible, it isn't binary compatible and would result in java.lang.NoSuchMethodError: org.xbill.DNS.ARecord.getAddress()Ljava/net/InetAddress.

I'll stick to semver for this project, so I will consider this for the next major version.

@ibauersachs ibauersachs added this to the v4 milestone May 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants