RFR: 8253119: Remove the legacy PlainSocketImpl and PlainDatagramSocketImpl implementation
    Daniel Fuchs 
    dfuchs at openjdk.java.net
       
    Wed Jun 23 15:06:37 UTC 2021
    
    
  
On Wed, 23 Jun 2021 14:32:22 GMT, Alan Bateman <alanb at 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
    
    
More information about the net-dev
mailing list