<div dir="ltr">Hi, <div><br></div><div>Thanks for the response Kasper, the reason I sent the mail to core-libs is because <a class="gmail-issue-link" href="https://bugs.openjdk.org/browse/JDK-8263012" id="gmail-key-val" rel="5043705" style="font-family:"DejaVu Sans",sans-serif;font-size:14px;color:rgb(0,82,204)">JDK-8263012</a> is assigned to "core-libs". I added loom-devs to the chain.</div><div><br></div><div><br><div>What <span style="color:rgb(0,0,0);white-space:pre-wrap">Andrew Haley wrote is correct, it is also correct pretty much for every implementation of `AutoClosable` (although, unlike ExtentLocals, most implementations of AutoClosable will cause resource leak, and ExtentLocal can cause a big logical bug). The idea of `strong try-with-resources` seems to solve the problem (and can force better APIs in other places), is there a conversation about this feature?</span></div></div><div><span style="color:rgb(0,0,0);white-space:pre-wrap"><br></span></div><div><span style="color:rgb(0,0,0);white-space:pre-wrap">Yuval Paz</span></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jul 29, 2022 at 12:15 PM Kasper Nielsen <<a href="mailto:kasperni@gmail.com">kasperni@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br><div>On Thu, 28 Jul 2022 at 22:11, Holo The Sage Wolf <<a href="mailto:holo3146@gmail.com" target="_blank">holo3146@gmail.com</a>> wrote:<br></div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><p style="margin:0px 0px 1.2em">I have a question about the proposal, why not allow try-with-resources with this API?</p></div></blockquote><div>Hi,</div><div><br></div><div>For Loom related questions, <a href="mailto:loom-dev@openjdk.org" target="_blank">loom-dev@openjdk.org</a> is probably a better fit. </div><div><br></div><div>The main problem with TWR is that it cannot guard against non-nested use. </div><div>Because there are no way to force the user to call close(). See more here [1]</div><div><br></div><div>/Kasper</div><div><br></div><div>[1] <a href="https://mail.openjdk.org/pipermail/loom-dev/2021-June/002558.html" target="_blank">https://mail.openjdk.org/pipermail/loom-dev/2021-June/002558.html</a> </div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Holo The Wise Wolf Of Yoitsu</div></div>