RFR: 8244202: Implementation of JEP 418: Internet-Address Resolution SPI [v3]

Aleksei Efimov aefimov at openjdk.java.net
Wed Oct 20 11:52:40 UTC 2021


On Sun, 17 Oct 2021 21:03:56 GMT, Mark Sheppard <msheppar at openjdk.org> wrote:

> getByName requires a hostname lookup and getByAdress requires (eventually - I know the docs says there’s no reverse lookup) an address reverse lookup. Thus, a logical mapping is getByName —> lookupHostname, and getByAddr —> lookupAddress, but the opposite will occur getByName --> lookupAddresses and getByAddress --> lookupHostname. Therfore I proffer maps neatly to rename methods to resolveHostname and resolveAddress such that the mapping are getByName --> resolveHostname and getByAddress --> resolveAddress.

Thank you, Mark, for highlighting the naming contradiction in the `InetAddressResolver` interface method names. It can be solved by making these names symmetrical to `InetAddress` API.
In 302264810725f86a4569161754f7b052c78fd826 `InetAddressResolver` method names have been updated to stress input parameters type, which brings them in sync with `InetAddress` API:
- `InetAddressResolver.lookupAddresses` is renamed to `InetAddressResolver.lookupByName`
- `InetAddressResolver.lookupHostName` is renamed to `InetAddressResolver.lookupByAddress`

-------------

PR: https://git.openjdk.java.net/jdk/pull/5822


More information about the core-libs-dev mailing list