Hi, > On 10 Nov 2016, at 16:48, Alan Bateman <alan.bate...@oracle.com> wrote: > > On 10/11/2016 16:39, Mark Sheppard wrote: > >> Hi, > >> please oblige and review the change > >> > http://cr.openjdk.java.net/~msheppar/8164815/webrev/src/java.base/share/cl > asses/java/net/NetworkInterface.java.sdiff.html > >> > >> to address the issue raised in > >> https://bugs.openjdk.java.net/browse/JDK-8164815 > >> > >> It was found during testing that, when a system does not have at least one > >> configured network interface, the Enumeration is instantiated using a null > value, > >> which results in an unexpected NPE, when it is used. > >> > >> this change, adds a specific check of the return value from the getAll() > native method, and throws > >> a SocketException should a null value have been returned. > > Has there been any consideration given to returning an empty enumeration > and empty stream then there are no network interfaces configured? > > It has, but, for me at least, since the changes for 7120665 [1] require a > conformant implementation to support at least one network interface, it > seems more like an error if we encounter this situation.
I also support Chris' view here. If at least a loopback is expected, we should see an Exception otherwise. > > > Also, just on terminology then I assume it would be better to use "platform" > rather than "System" to keep consistency with the existing javadoc. > > Agreed. Maybe you want to replace the word "machine" with "system" in the Javadoc of both methods. It is used in some other places in NetworkInterface.java and sounds a bit better to my eyes - but it's a matter of taste, of course. In general this seems a good change to be done to me. Best regards Christoph