JDK-8134577 : Eliminate or standardize a replacement for sun.net.spi.nameservice.NameServiceDescriptor
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 9
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2015-08-27
  • Updated: 2017-11-30
  • Resolved: 2016-04-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b114Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Sub Tasks
JDK-8176361 :  
Description
InetAddress has a JDK-internal service provider interface (the service type is sun.net.spi.nameservice.NameServiceDescriptor).

This issue requests that this service provider interface be re-examined with a view to either removing sun.net.spi.nameservice.NameServiceDescriptor or else replacing it with a standard SPI. The motive for this request is modules where we need to avoid Java SE modules depending on non-standard service interfaces.

One suggestion is to remove the current mechanism and replace it with a way to configure InetAddress to use a local hosts file. That should be good enough for almost all of the test usages.
Comments
Review thread ( spanning several months ): http://mail.openjdk.java.net/pipermail/net-dev/2015-October/thread.html#9292 http://mail.openjdk.java.net/pipermail/net-dev/2015-November/thread.html#9311 http://mail.openjdk.java.net/pipermail/net-dev/2015-December/009424.html http://mail.openjdk.java.net/pipermail/net-dev/2016-January/thread.html#9427 http://mail.openjdk.java.net/pipermail/net-dev/2016-March/thread.html#9604
30-11-2017

During verification AutoVerify tool search tests with "@bug 8134577" tag (in this particular case). If all tests with this tag passed, AutoVerify close 8134577 as passed. Which tests with "@bug 8134577" failed?
07-06-2016

The changes to module-info.java's in the above webrev look fine.
07-04-2016

current version with amendments made for modules http://cr.openjdk.java.net/~msheppar/8134577/webrev.10/
07-04-2016

webrev at http://cr.openjdk.java.net/~msheppar/8134577/webrev.08/
08-01-2016

The current webrev still throws ServiceConfigurationError, I thought that was going to be removed. Also I would assume sun.net.www.spi.Name* should go away at some point too. Otherwise I think it would be good to get this one moving.
12-10-2015

I'm seeing contradictory statements, which is confusing. is the network property sun.net.spi.nameservice.provider. to be supported ? if not, then when it is read and processed during the execution of a static initializer in InetAddress, then the throwing of ServiceConfigurationError seems appropriate. if it is, but without the sun dns option, then there are other failures have to be addressed.
27-08-2015

If the old sun.net.spi.nameservice.NameServiceDescriptor is removed and InetAddress does not use service loader, then I do not think that ServiceConfigurationError is appropriate ( since there is no service lookup use ). If the sun.net.spi.nameservice.provider property is set then a warning, or similar, should probably be issued.
27-08-2015

I see some of the garage from comments from JDK-8042897 have been copied over, I was hoping to leave those behind. In summary, this issue is about changing InetAddress to drop the legacy service provider mechanism and replace it with a simple mechanism to configure InetAddress to use a hosts file. Part of this will of course mean replacing the tests for this feature.
27-08-2015

The former. Remove it completely, and replace it with a simple mechanism that is file based and can be implemented with a simple system property ( no service loader ). Maybe something like: $ cat /tmp/myHosts 123.432.123.432 foo java -Djdk.internal.hosts=/tmp/myHosts <main-class> ...
27-08-2015

To clarify. do you wish to eliminate the setting of the NS service provider via the network property sun.net.spi.nameservice.provider.<n>=<default|dns,sun|...> or is it just the sun implementation?
27-08-2015