RFR: 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException [v8]

Jaikiran Pai jpai at openjdk.org
Wed May 7 11:34:08 UTC 2025


On Wed, 7 May 2025 11:16:48 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>>> Okay with me but for SocketImpl then I think it has to be an apiNote as the create method is not deprecated. 
>> 
>> Makes sense.
>> 
>>> BTW: "Use DatagramSocket instead for UDP transport" switches the terminology. The first sentence uses "datagram socket" so I best to use that in the second sentence to avoid "UDP" and "transport".
>> 
>> I agree, I'll use "datagram socket".
>
> Thanks Jaikiran. Yes - it feels weird to add an `@apiNote` to a method or constructor that has long been deprecated: if it's deprecated you're not supposed to use it. I couldn't help feeling that using an `@apiNote` there conveyed the wrong message. I am completely OK with the `@apiNote` on the `create` method though - since that one isn't deprecated.

I've updated the PR to move the text into `@deprecated` section for these 2 constructors. I'll update the CSR once this new text is approved.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/25031#discussion_r2077420523


More information about the net-dev mailing list