On Tue, 26 Oct 2021 16:24:48 GMT, Aleksei Efimov <aefi...@openjdk.org> wrote:

>> This change implements a new service provider interface for host name and 
>> address resolution, so that java.net.InetAddress API can make use of 
>> resolvers other than the platform's built-in resolver.
>> 
>> The following API classes are added to `java.net.spi` package to facilitate 
>> this:
>> - `InetAddressResolverProvider` -  abstract class defining a service, and 
>> is, essentially, a factory for `InetAddressResolver` resolvers.
>> - `InetAddressResolverProvider.Configuration ` - an interface describing the 
>> platform's built-in configuration for resolution operations that could be 
>> used to bootstrap a resolver construction, or to implement partial 
>> delegation of lookup operations.
>> - `InetAddressResolver` - an interface that defines methods for the 
>> fundamental forward and reverse lookup operations.
>> - `InetAddressResolver.LookupPolicy` - a class whose instances describe the 
>> characteristics of one forward lookup operation.  
>> 
>> More details in [JEP-418](https://openjdk.java.net/jeps/418).
>> 
>> Testing: new and existing `tier1:tier3` tests
>
> Aleksei Efimov has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Add @ throws NPE to hosts file resolver javadoc

src/java.base/share/classes/java/net/InetAddress.java line 841:

> 839:         // 'resolver.lookupByAddress' and 'InetAddress.getAllByName0' 
> delegate to the system-wide resolver,
> 840:         // which could be a custom one. At that point we treat any 
> unexpected RuntimeException thrown by
> 841:         // the resolver as we would treat an UnknownHostException or an 
> unmatched host name.

indentation issue in comment above

src/java.base/share/classes/java/net/InetAddress.java line 1308:

> 1306:      * Creates an InetAddress based on the provided host name and IP 
> address.
> 1307:      * System {@linkplain InetAddressResolver resolver} is not used to 
> check
> 1308:      * the validity of the address.

Is this term "system resolver" defined somewhere? I think it means the 
configured resolver for the current VM. Previously, it really was the system 
resolver. So, I think it's potentially confusing, as there is also reference to 
the java.net.preferIPv6Addresses system property as having a possible value 
"system" which refers to the operating system. Since the CSR is approved, I'm 
happy to discuss this point post integration.

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

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

Reply via email to