--- a/src/java.base/share/classes/java/net/DatagramSocket.java Fri Sep 20 11:33:30 2019 +0800
+++ b/src/java.base/share/classes/java/net/DatagramSocket.java Fri Sep 20 11:07:52 2019 +0100
@@ -188,9 +188,9 @@
* with 0 as its argument to ensure the operation is allowed.
* This could result in a SecurityException.
*
- * @exception SocketException if the socket could not be opened,
+ * @throws SocketException if the socket could not be opened,
* or the socket could not bind to the specified local port.
- * @exception SecurityException if a security manager exists and its
+ * @throws SecurityException if a security manager exists and its
* {@code checkListen} method doesn't allow the operation.
*
* @see SecurityManager#checkListen
@@ -229,9 +229,9 @@
* @param bindaddr local socket address to bind, or {@code null}
* for an unbound socket.
*
- * @exception SocketException if the socket could not be opened,
+ * @throws SocketException if the socket could not be opened,
* or the socket could not bind to the specified local port.
- * @exception SecurityException if a security manager exists and its
+ * @throws SecurityException if a security manager exists and its
* {@code checkListen} method doesn't allow the operation.
*
* @see SecurityManager#checkListen
@@ -263,9 +263,9 @@
* This could result in a SecurityException.
*
* @param port port to use.
- * @exception SocketException if the socket could not be opened,
+ * @throws SocketException if the socket could not be opened,
* or the socket could not bind to the specified local port.
- * @exception SecurityException if a security manager exists and its
+ * @throws SecurityException if a security manager exists and its
* {@code checkListen} method doesn't allow the operation.
*
* @see SecurityManager#checkListen
@@ -290,9 +290,9 @@
* @param port local port to use
* @param laddr local address to bind
*
- * @exception SocketException if the socket could not be opened,
+ * @throws SocketException if the socket could not be opened,
* or the socket could not bind to the specified local port.
- * @exception SecurityException if a security manager exists and its
+ * @throws SecurityException if a security manager exists and its
* {@code checkListen} method doesn't allow the operation.
*
* @see SecurityManager#checkListen
@@ -635,17 +635,17 @@
*
* @param p the {@code DatagramPacket} to be sent.
*
- * @exception IOException if an I/O error occurs.
- * @exception SecurityException if a security manager exists and its
+ * @throws IOException if an I/O error occurs.
+ * @throws SecurityException if a security manager exists and its
* {@code checkMulticast} or {@code checkConnect}
* method doesn't allow the send.
- * @exception PortUnreachableException may be thrown if the socket is connected
+ * @throws PortUnreachableException may be thrown if the socket is connected
* to a currently unreachable destination. Note, there is no
* guarantee that the exception will be thrown.
- * @exception java.nio.channels.IllegalBlockingModeException
+ * @throws java.nio.channels.IllegalBlockingModeException
* if this socket has an associated channel,
* and the channel is in non-blocking mode.
- * @exception IllegalArgumentException if the socket is connected,
+ * @throws IllegalArgumentException if the socket is connected,
* and connected address and packet address differ.
*
* @see java.net.DatagramPacket
@@ -714,13 +714,13 @@
*
* @param p the {@code DatagramPacket} into which to place
* the incoming data.
- * @exception IOException if an I/O error occurs.
- * @exception SocketTimeoutException if setSoTimeout was previously called
+ * @throws IOException if an I/O error occurs.
+ * @throws SocketTimeoutException if setSoTimeout was previously called
* and the timeout has expired.
- * @exception PortUnreachableException may be thrown if the socket is connected
+ * @throws PortUnreachableException may be thrown if the socket is connected
* to a currently unreachable destination. Note, there is no guarantee that the
* exception will be thrown.
- * @exception java.nio.channels.IllegalBlockingModeException
+ * @throws java.nio.channels.IllegalBlockingModeException
* if this socket has an associated channel,
* and the channel is in non-blocking mode.
* @see java.net.DatagramPacket
@@ -951,9 +951,9 @@
* @param size the size to which to set the send buffer
* size. This value must be greater than 0.
*
- * @exception SocketException if there is an error
+ * @throws SocketException if there is an error
* in the underlying protocol, such as an UDP error.
- * @exception IllegalArgumentException if the value is 0 or is
+ * @throws IllegalArgumentException if the value is 0 or is
* negative.
* @see #getSendBufferSize()
*/
@@ -972,7 +972,7 @@
* buffer size used by the platform for output on this {@code DatagramSocket}.
*
* @return the value of the SO_SNDBUF option for this {@code DatagramSocket}
- * @exception SocketException if there is an error in
+ * @throws SocketException if there is an error in
* the underlying protocol, such as an UDP error.
* @see #setSendBufferSize
*/
@@ -1009,9 +1009,9 @@
* @param size the size to which to set the receive buffer
* size. This value must be greater than 0.
*
- * @exception SocketException if there is an error in
+ * @throws SocketException if there is an error in
* the underlying protocol, such as an UDP error.
- * @exception IllegalArgumentException if the value is 0 or is
+ * @throws IllegalArgumentException if the value is 0 or is
* negative.
* @see #getReceiveBufferSize()
*/
@@ -1030,7 +1030,7 @@
* buffer size used by the platform for input on this {@code DatagramSocket}.
*
* @return the value of the SO_RCVBUF option for this {@code DatagramSocket}
- * @exception SocketException if there is an error in the underlying protocol, such as an UDP error.
+ * @throws SocketException if there is an error in the underlying protocol, such as an UDP error.
* @see #setReceiveBufferSize(int)
*/
public synchronized int getReceiveBufferSize()
@@ -1070,7 +1070,7 @@
* is not defined.
*
* @param on whether to enable or disable the
- * @exception SocketException if an error occurs enabling or
+ * @throws SocketException if an error occurs enabling or
* disabling the {@code SO_REUSEADDR} socket option,
* or the socket is closed.
* @since 1.4
@@ -1093,7 +1093,7 @@
* Tests if SO_REUSEADDR is enabled.
*
* @return a {@code boolean} indicating whether or not SO_REUSEADDR is enabled.
- * @exception SocketException if there is an error
+ * @throws SocketException if there is an error
* in the underlying protocol, such as an UDP error.
* @since 1.4
* @see #setReuseAddress(boolean)
@@ -1131,7 +1131,7 @@
/**
* Tests if SO_BROADCAST is enabled.
* @return a {@code boolean} indicating whether or not SO_BROADCAST is enabled.
- * @exception SocketException if there is an error
+ * @throws SocketException if there is an error
* in the underlying protocol, such as an UDP error.
* @since 1.4
* @see #setBroadcast(boolean)
@@ -1290,10 +1290,10 @@
* This could result in a SecurityException.
*
* @param fac the desired factory.
- * @exception IOException if an I/O error occurs when setting the
+ * @throws IOException if an I/O error occurs when setting the
* datagram socket factory.
- * @exception SocketException if the factory is already defined.
- * @exception SecurityException if a security manager exists and its
+ * @throws SocketException if the factory is already defined.
+ * @throws SecurityException if a security manager exists and its
* {@code checkSetFactory} method doesn't allow the operation.
* @see java.net.DatagramSocketImplFactory#createDatagramSocketImpl()
* @see SecurityManager#checkSetFactory