On Wed, 23 Jun 2021 14:32:22 GMT, Alan Bateman <al...@openjdk.org> wrote:
>> Yes - the constructor would throw NPE - but there's no need to call this >> constructor if `impl` is null here - it's better to fail early. > > This is probably a case where the spec needs say that an error (maybe an > unspecified error) is thrown if the custom factory's createDatagramSocketImpl > returns null. We can create a separate issue for that as it's probably > existed forever. @AlanBateman `protected DatagramSocket(DatagramSocketImpl impl)` throws NPE if `impl` is `null`. (this is covered by the blanket statement for NPE) Do we really need to specify anything else since the global `setDatagramSocketImplFactory` method has been deprecated? I mean - though we still support it at the moment, using a `DatagramSocketImplFactory` is not recommended, and hopefully only old legacy code would be using that. ------------- PR: https://git.openjdk.java.net/jdk/pull/4574