8212132: (dc) Remove DatagramChannelImpl finalize method

Martin Buchholz martinrb at google.com
Wed Oct 23 18:21:40 UTC 2019


On Wed, Oct 23, 2019 at 2:52 AM Chris Hegarty <chris.hegarty at oracle.com>
wrote:

>
> + 1. I’ve taken a careful pass over the source changes, since they follow
> a pattern of leaking `this` in the constructor and implementing a cleaning
> action with be a lambda, both of which require careful consideration, but
> the changes LGTM.
>

One possible safety idiom is to consistently have a static method returning
a lambda (and don't pass in this!) , e.g.

private static Runnable cleanerFor(FileDescriptor fd) { return () -> ...; }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20191023/7512b668/attachment-0001.html>


More information about the nio-dev mailing list