You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
getAddress() in ARecord/AAAARecord should return Inet4Address/Inet6Address #101
AAAARecord.getAddress() should return Inet6Address (not feasible since Java creates Inet4Address instances for ::ffff:0.0.0.0/96)
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.
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.
Since Java creates Inet4Address instances for IPv4 mapped addresses (::ffff:0:0/96, Java 22 example: Inet6Address.ofLiteral("::ffff:192.0.2.1")), it’s not possible to map all AAAA records to Inet6Address. But Inet4Address would always be possible for A records.
Activity
ibauersachs commentedon May 2, 2020
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.
maffe commentedon Sep 12, 2024
Since Java creates
Inet4Addressinstances for IPv4 mapped addresses (::ffff:0:0/96, Java 22 example:Inet6Address.ofLiteral("::ffff:192.0.2.1")), it’s not possible to map allAAAArecords toInet6Address. ButInet4Addresswould always be possible forArecords.