Skip to content

Commit 40be1eb

Browse files
committed
Fix error message
1 parent fca76d1 commit 40be1eb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/jdk/java/net/Socket/UdpSocket.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,11 @@ private Socket newUdpSocket() throws IOException, InterruptedException {
142142
return new Socket(InetAddress.getLoopbackAddress(), 8000, false);
143143
} catch (BindException be) {
144144
unexpected = be;
145-
System.out.printf("BindException caught: retry Socket creation [%s/%s]%n",
146-
i+1, MAX_RETRIES);
147-
Thread.sleep(10 + 10 * i);
145+
if (i != MAX_RETRIES - 1) {
146+
System.out.printf("BindException caught: retry Socket creation [%s/%s]%n",
147+
i + 1, MAX_RETRIES);
148+
Thread.sleep(10 + 10 * i);
149+
}
148150
}
149151
}
150152
throw unexpected;

0 commit comments

Comments
 (0)