Hi,

Please review a follow up to Stuart's Enumeration.asIterator patch that adds 
some Stream return methods to classes where there is only Enumeration returning 
methods to support traversal:

  
http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8081678-enumeration-and-stream/webrev/

I took the opportunity to sprinkle some Enumerator.asIterator impls.

I originally included some methods on ClassLoader but Alan wisely warned me 
away from doing that as this area is likely to be impacted by modularity.

There is one small area of uncertainty with NetworkInterface. Can the following 
method ever return null?

 342     public static Enumeration<NetworkInterface> getNetworkInterfaces()
 343         throws SocketException {
 344         NetworkInterface[] netifs = getAll();
 345 
 346         // specified to return null if no network interfaces
 347         return netifs != null
 348                ? enumerationFromArray(netifs)
 349                : null;
 350     }

Contrary to the comment i cannot find any specification. For the stream 
returning method, networkInterfaces, i have specified this to return an empty 
stream, thus it might be good to update the enumeration returning method as 
well to say whether it returns null or an empty enumeration.

Paul.

Reply via email to