test/jdk/java/net/Socket/UdpSocket.java
branchniosocketimpl-branch
changeset 57313 14b02c7b27b8
parent 57309 dbd1beb994ab
child 57341 733e9746d615
--- a/test/jdk/java/net/Socket/UdpSocket.java	Tue Apr 09 11:48:54 2019 +0100
+++ b/test/jdk/java/net/Socket/UdpSocket.java	Tue Apr 09 12:02:23 2019 +0100
@@ -137,8 +137,9 @@
     }
 
     private static void closeAll(Deque<Socket> sockets) throws IOException {
-        sockets.forEach(s -> {
-            try { s.close(); } catch (IOException ignore) { }
-        });
+        Socket s;
+        while ((s = sockets.poll()) != null) {
+            s.close();
+        }
     }
 }