RFR: 8313239: InetAddress.getCanonicalHostName may return ip address if reverse lookup fails [v5]

Jaikiran Pai jpai at openjdk.org
Fri Aug 4 13:01:00 UTC 2023


On Fri, 4 Aug 2023 11:12:00 GMT, Aleksei Efimov <aefimov at openjdk.org> wrote:

>> Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   more clarification of the semantics
>
> src/java.base/share/classes/java/net/InetAddress.java line 825:
> 
>> 823: 
>> 824:     /**
>> 825:      * Returns the fully qualified domain for this address.
> 
> Both `getHostName` and `getCanonicalHostName` talk about `fully qualified domain name`, and how the system-wide resolver  is used to determine it. But [InetAddressResolver.lookupByAddress](https://docs.oracle.com/en/java/javase/20/docs/api/java.base/java/net/spi/InetAddressResolver.html#lookupByAddress(byte%5B%5D)) talks about host name, maybe it should be updated to use FQDN term?
> 
> `name` is missing here: `fully qualified domain` -> `fully qualified domain name`

Hello Aleksei,

> But [InetAddressResolver.lookupByAddress](https://docs.oracle.com/en/java/javase/20/docs/api/java.base/java/net/spi/InetAddressResolver.html#lookupByAddress(byte%5B%5D)) talks about host name, maybe it should be updated to use FQDN term?

Should we address that in this PR or a separate one?

> name is missing here: fully qualified domain -> fully qualified domain name

Good catch. Fixed.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15134#discussion_r1284386316


More information about the net-dev mailing list