# HG changeset patch # User pconcannon # Date 1572001556 -3600 # Node ID 1bd307ea54971ed22f83a7d1321229ea180d937a # Parent 808bbdb79916a4447a4f7db60fe870efd6303080 8231570: (dc) Clarify implicit bind behavior of DatagramChannel Summary: Update to DatagramChannel spec to make it clear that SecurityException can be thrown in connect send and receive methods Reviewed-by: alanb, chegar, dfuchs diff -r 808bbdb79916 -r 1bd307ea5497 src/java.base/share/classes/java/nio/channels/DatagramChannel.java --- a/src/java.base/share/classes/java/nio/channels/DatagramChannel.java Fri Oct 25 17:30:25 2019 +0200 +++ b/src/java.base/share/classes/java/nio/channels/DatagramChannel.java Fri Oct 25 12:05:56 2019 +0100 @@ -305,8 +305,10 @@ * If the type of the given remote address is not supported * * @throws SecurityException - * If a security manager has been installed - * and it does not permit access to the given remote address + * If a security manager has been installed and it does not + * permit access to the given remote address, or if unbound, + * the security manager {@link SecurityManager#checkListen checkListen} + * method denies the operation * * @throws IOException * If some other I/O error occurs @@ -409,6 +411,11 @@ * closing the channel and setting the current thread's * interrupt status * + * @throws SecurityException + * If unbound, and a security manager has been installed and + * its {@link SecurityManager#checkListen checkListen} method + * denies the operation + * * @throws IOException * If some other I/O error occurs */ @@ -480,9 +487,10 @@ * If the type of the given remote address is not supported * * @throws SecurityException - * If a security manager has been installed - * and it does not permit datagrams to be sent - * to the given address + * If a security manager has been installed and it does not permit + * datagrams to be sent to the given address, or if unbound, and + * the security manager's {@link SecurityManager#checkListen checkListen} + * method denies the operation * * @throws IOException * If some other I/O error occurs