On Thu, 21 Nov 2024 18:43:55 GMT, Daniel Fuchs <dfu...@openjdk.org> wrote:
> Please find here a patch that removes use of SecurityManager and doPrivileged > in DatagramSocket/MulticastSocket implementation. > > Some allusion to the SecurityManager was missed in DatagramSocket::connect, > so this patch contains a small API documentation change that will require a > CSR. src/java.base/share/classes/java/net/DatagramSocket.java line 391: > 389: * > 390: * <p> When a socket is connected, additional checks are performed > 391: * on a send operation: if the packet's address is set and the > packet's address Yes, an oversight that the "Care should be taken ..." wasn't removed as part of JEP 486. Opinions may differ but I think it may be simpler to remove this sentence completely rather than re-word it. The right place to specify that send may throw IAE is in the send method description and is already does this. If you do want to keep something it could be reduced down to: "When the socket is connected, the send method checks that the packet's address matches the remote address that the socket is connected to", no need to say anything about IAE. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22303#discussion_r1853420580