< prev index next >
src/java.base/share/classes/java/net/DatagramSocket.java
Print this page
rev 56290 : 8230648: Replace @exception tag with @throws in java.base
Summary: Minor coding style update of javadoc tag in any file in java.base
Reviewed-by: prappo, lancea
@@ -186,13 +186,13 @@
* <p>If there is a security manager,
* its {@code checkListen} method is first called
* 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
*/
public DatagramSocket() throws SocketException {
@@ -227,13 +227,13 @@
* This could result in a SecurityException.
*
* @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
* @since 1.4
*/
@@ -261,13 +261,13 @@
* with the {@code port} argument
* as its argument to ensure the operation is allowed.
* 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
*/
public DatagramSocket(int port) throws SocketException {
@@ -288,13 +288,13 @@
* This could result in a SecurityException.
*
* @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
* @since 1.1
*/
@@ -633,21 +633,21 @@
* {@code p.getPort()}. Each call to a security manager method
* could result in a SecurityException if the operation is not allowed.
*
* @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
* @see SecurityManager#checkMulticast(InetAddress)
* @see SecurityManager#checkConnect
@@ -712,17 +712,17 @@
* security manager's {@code checkAccept} method
* does not allow it.
*
* @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
* @see java.net.DatagramSocket
* @revised 1.4
@@ -949,13 +949,13 @@
* packet is sent or discarded.
*
* @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()
*/
public synchronized void setSendBufferSize(int size)
throws SocketException{
@@ -970,11 +970,11 @@
/**
* Get value of the SO_SNDBUF option for this {@code DatagramSocket}, that is the
* 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
*/
public synchronized int getSendBufferSize() throws SocketException {
if (isClosed())
@@ -1007,13 +1007,13 @@
* than SO_RCVBUF can be received.
*
* @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()
*/
public synchronized void setReceiveBufferSize(int size)
throws SocketException{
@@ -1028,11 +1028,11 @@
/**
* Get value of the SO_RCVBUF option for this {@code DatagramSocket}, that is the
* 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()
throws SocketException{
if (isClosed())
@@ -1068,11 +1068,11 @@
* The behaviour when {@code SO_REUSEADDR} is enabled or
* disabled after a socket is bound (See {@link #isBound()})
* 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
* @see #getReuseAddress()
* @see #bind(SocketAddress)
@@ -1091,11 +1091,11 @@
/**
* 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)
*/
public synchronized boolean getReuseAddress() throws SocketException {
@@ -1129,11 +1129,11 @@
}
/**
* 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)
*/
public synchronized boolean getBroadcast() throws SocketException {
@@ -1288,14 +1288,14 @@
* the security manager's {@code checkSetFactory} method
* to ensure the operation is allowed.
* 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
* @since 1.3
*/
< prev index next >