8231570: (dc) Clarify implicit bind behavior of DatagramChannel
authorpconcannon
Fri, 25 Oct 2019 12:05:56 +0100
changeset 58803 1bd307ea5497
parent 58802 808bbdb79916
child 58804 0942a1f47d26
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
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