try-with-resources and null resource (original) (raw)
Stephen Colebourne scolebourne at joda.org
Thu Jan 27 06:52:13 PST 2011
- Previous message: try-with-resources and null resource
- Next message: try-with-resources and null resource
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: try-with-resources and null resource
- Next message: try-with-resources and null resource
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]