On Wed, 5 Oct 2022 20:24:59 GMT, Chris Plummer <cjplum...@openjdk.org> wrote:

>> No, restoration requires a call to close. Maybe you are assuming that 
>> AutoCloseable implementations setup a cleaner to do that?
>
> Yes, that was my point of confusion. I thought collection triggered calling 
> close, but I see now when you want it to be closed, you rely on 
> try-with-resources to call close() method.

I've updated it to replace the use of try-with-resources with a try-finally 
that explicitly restores and maybe that will be easier to understand.

-------------

PR: https://git.openjdk.org/jdk/pull/10562

Reply via email to