Summary
DatagramSocket::connect API documentation is modified to remove allusions to security checks performed by the SecurityManager
Problem
The DatagramSocket::connect API documentation has a warning that a connected socket should not be shared with untrusted code since security checks on the connected address are only performed at connect time. With the SecurityManager removed by JEP 486 this is no longer relevant.
Solution
Update the API documentation of DatagramSocket::connect.
Specification
In src/java.base/share/classes/java/net/DatagramSocket.java:
- * <p> When a socket is connected, additional checks are performed
- * on a send operation: if the packet's address is set and the packet's address
- * and the socket's address do not match, an {@code IllegalArgumentException}
- * will be thrown. A socket connected to a multicast address may only
+ * <p> When the socket is connected, the send method checks that the
+ * packet's address matches the remote address that the socket is
+ * connected to. A socket connected to a multicast address may only
* be used to send packets. Datagrams in the socket's {@linkplain
* java.net.StandardSocketOptions#SO_RCVBUF socket receive buffer}, which
* have not been {@linkplain #receive(DatagramPacket) received} before invoking
* this method, may be discarded.
*
[...]
* @since 1.2
*/
public void connect(InetAddress address, int port) {
- csr of
-
JDK-8344217 Remove calls to SecurityManager and doPrivileged in java.net.DatagramSocket and java.net.NetMulticastSocket after JEP 486 integration
- In Progress