8212132: (dc) Remove DatagramChannelImpl finalize method

Alan Bateman Alan.Bateman at oracle.com
Thu Oct 24 14:20:57 UTC 2019



On 23/10/2019 21:46, Alan Bateman wrote:
> On 23/10/2019 21:38, Martin Buchholz wrote:
>>
>> :
>>
>> You would call it like this:
>> this.cleanable = CleanerFactory.cleaner().register(this, cleanerFor(fd));
>> It's just moving code around, and only slightly safer/more disciplined.
> Okay, that might be a bit cleaner although it would be two static 
> factories as the cleaning action is different for TCP vs. UDP.
I've updated the proposed change to invoke the register method in the 
constructor. Also added the @requires to the test so that it is clearer 
that it doesn't run on Windows. I've left the check for 
UnixOperatingSystemMXBean in the test as I can't be sure that it can be 
obtained on some of exotic ports. The new webrev is here:

http://cr.openjdk.java.net/~alanb/8212132/webrev.02/index.html

-Alan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20191024/e69a591d/attachment.html>


More information about the nio-dev mailing list