On Wed, 23 Jun 2021 15:01:45 GMT, Daniel Fuchs <dfu...@openjdk.org> wrote:

>> 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.

Creating an issue to update DatagramSocketImplFactory.createDatagramSocketImpl 
to say that returning null leads to undefined behavior or DatagramSocket 
constructors throwing an error is fine, I wasn't suggesting we have to fix it 
here.

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

PR: https://git.openjdk.java.net/jdk/pull/4574

Reply via email to