# HG changeset patch # User pconcannon # Date 1571220767 -3600 # Node ID 04946947ca79a59966de15a2354264deb2ebfdc8 # Parent eb172a3b1c1cc58ec7e491e4cf48fcc9d4fd8e53 8231719: Correct contradictions in timeout range descriptions. Summary: Clarified verbiage in method descriptions. Reviewed-by: chegar, dfuchs diff -r eb172a3b1c1c -r 04946947ca79 src/java.base/share/classes/java/net/DatagramSocket.java --- a/src/java.base/share/classes/java/net/DatagramSocket.java Thu Oct 17 08:56:06 2019 +0100 +++ b/src/java.base/share/classes/java/net/DatagramSocket.java Wed Oct 16 11:12:47 2019 +0100 @@ -888,14 +888,14 @@ } /** Enable/disable SO_TIMEOUT with the specified timeout, in - * milliseconds. With this option set to a non-zero timeout, + * milliseconds. With this option set to a positive timeout value, * a call to receive() for this DatagramSocket * will block for only this amount of time. If the timeout expires, * a java.net.SocketTimeoutException is raised, though the - * DatagramSocket is still valid. The option must be enabled - * prior to entering the blocking operation to have effect. The - * timeout must be {@code > 0}. - * A timeout of zero is interpreted as an infinite timeout. + * DatagramSocket is still valid. A timeout of zero is interpreted + * as an infinite timeout. + * The option must be enabled prior to entering the blocking + * operation to have effect. * * @param timeout the specified timeout in milliseconds. * @throws SocketException if there is an error in the underlying protocol, such as an UDP error. diff -r eb172a3b1c1c -r 04946947ca79 src/java.base/share/classes/java/net/ServerSocket.java --- a/src/java.base/share/classes/java/net/ServerSocket.java Thu Oct 17 08:56:06 2019 +0100 +++ b/src/java.base/share/classes/java/net/ServerSocket.java Wed Oct 16 11:12:47 2019 +0100 @@ -749,14 +749,15 @@ /** * Enable/disable {@link SocketOptions#SO_TIMEOUT SO_TIMEOUT} with the - * specified timeout, in milliseconds. With this option set to a non-zero - * timeout, a call to accept() for this ServerSocket + * specified timeout, in milliseconds. With this option set to a positive + * timeout value, a call to accept() for this ServerSocket * will block for only this amount of time. If the timeout expires, * a java.net.SocketTimeoutException is raised, though the - * ServerSocket is still valid. The option must be enabled - * prior to entering the blocking operation to have effect. The - * timeout must be {@code > 0}. - * A timeout of zero is interpreted as an infinite timeout. + * ServerSocket is still valid. A timeout of zero is interpreted as an + * infinite timeout. + * The option must be enabled prior to entering the blocking + * operation to have effect. + * * @param timeout the specified timeout, in milliseconds * @throws SocketException if there is an error in the underlying protocol, * such as a TCP error diff -r eb172a3b1c1c -r 04946947ca79 src/java.base/share/classes/java/net/Socket.java --- a/src/java.base/share/classes/java/net/Socket.java Thu Oct 17 08:56:06 2019 +0100 +++ b/src/java.base/share/classes/java/net/Socket.java Wed Oct 16 11:12:47 2019 +0100 @@ -1171,13 +1171,12 @@ /** * Enable/disable {@link SocketOptions#SO_TIMEOUT SO_TIMEOUT} * with the specified timeout, in milliseconds. With this option set - * to a non-zero timeout, a read() call on the InputStream associated with + * to a positive timeout value, a read() call on the InputStream associated with * this Socket will block for only this amount of time. If the timeout * expires, a java.net.SocketTimeoutException is raised, though the - * Socket is still valid. The option must be enabled - * prior to entering the blocking operation to have effect. The - * timeout must be {@code > 0}. - * A timeout of zero is interpreted as an infinite timeout. + * Socket is still valid. A timeout of zero is interpreted as an infinite timeout. + * The option must be enabled prior to entering the blocking operation + * to have effect. * * @param timeout the specified timeout, in milliseconds. * @throws SocketException if there is an error in the underlying protocol,