8238231: Custom DatagramSocketImpl's create method not called when with protected constructor

Daniel Fuchs daniel.fuchs at oracle.com
Fri Jan 31 21:42:53 UTC 2020


On 31/01/2020 20:45, Alan Bateman wrote:
> On 31/01/2020 19:42, Daniel Fuchs wrote:
> Good, this version is correct. I see that getImpl() is synchronizing on 
> "this". I guess that is okay but synchronizing on the impl is another 
> choice here.

Yes. Well I syncronized on `this` because other methods such as
`bind` or `connectInternal` already synchronize on `this`.
If the impl has not been created it's more likely that it will
be by one of these.

> Did you mean to include the SetReceiveBufferSize test in this webrev? 
> The change is okay but if we are touching that test then it would be 
> better to change it to try-with-resources.

Yes - I noticed the leak a few days ago. I was waiting for an
opportunity to push it. Changed as suggested.

http://cr.openjdk.java.net/~dfuchs/webrev_8238231/webrev.03/\

-- daniel

> 
> -Alan



More information about the net-dev mailing list