RFR: JDK-8134577 - Eliminate or standardize a replacement for sun.net.spi.nameservice.NameServiceDescriptor

Mark Sheppard mark.sheppard at oracle.com
Sun Oct 25 23:32:09 UTC 2015

    please oblige and review the following changes

which address the issue raised in

the operative word has been "eliminate".
As such, the interface and service descriptor 
*together with its implementation (sun.net.nameservice.dns.DNSNameService)
has been remove from the JDK libraries.

The immediate impact is seen in the JDK testing framework.

To facilitate testing activity, and provide a replacement for the 
customized NameService implementations in the
JDK tests,  the default NameService has been extended to support
the retrieval of host to IP address mappings from a file.
The file path is specified with a system property " jdk.internal.hosts".

Previously a nameservice provider was specified by setting the system 
"sun.net.spi.nameservice.provider.", as per the documentation

InetAddress now tests to determine if this property is set and will 
throw a ServiceConfigurationError
indicating that this functionality is no longer supported. The choice of 
ServideConfigurationError may cause
some debate, or disagreement. The rationale was that InternalError, is 
documented to relate to a JVM error,
and javax.naming.NamingException has a context of DirContext.
A possible alternative candidate could be 
As such, the setting of the property "sun.net.spi.nameservice.provider." 
was used, previously, as a configuration
parameter for the loading of a NamerService service provider, and as 
this is now (considered) an error, ServiceConfigurationError,
seemed a best fit!

These changes impacted a number of jdk security tests, also. The 
affected tetsts have been amended to adopt the
changes, with the exception of 
which will require some rewrite.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/security-dev/attachments/20151025/0720fde6/attachment.html>

More information about the security-dev mailing list