Skip to content

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

@maffe

Description

@maffe

To avoid having to cast in client code,

  • ARecord.getAddress() should return Inet4Address
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions