try-with-resources and null resource

Stephen Colebourne scolebourne at joda.org
Thu Jan 27 06:52:13 PST 2011


On 27 January 2011 14:47, Tim Peierls <tim at peierls.net> wrote:
> Bruce Chapman already made a good case for not calling close on null
> resource. This code *would* work in that case.
>
>> Executive summary: C# has got it right. Null resources should be silently
>> be accepted.
>
> I don't know about C#, but I like the formulation that can be sloppily
> summarized as "t-w-r calls close on non-null resources".
>
> Perhaps we violently agree?

Looks like we do agree.

Stephen



More information about the coin-dev mailing list