review request for 7022624, convert java.io test to use try-with-resources
stuart.marks at oracle.com
Mon Feb 28 22:29:48 UTC 2011
Here's a small webrev with changes to a handful of java.io tests to use TWR.
I have a few minor questions:
Should the channel corresponding to a stream be considered a separate resource,
or is it more like another object that represents the "same" resource? Since
closing one closes the other, I treated them as peers and I didn't unroll the
FileOutputStream and its channel into separate resource variables. However, I'm
flexible on this.
Pretty clearly a ServerSocket is a distinct resource from a Socket returned
from the accept() call. However, does Socket.getInputStream() represent a
distinct resource from the Socket? In this case it seemed most sensible to
unroll them into separate resource variables, but again I could go either way
Please check over my NIO usage here. Hm, I did more conversion here than in the
other FailingConstructors tests (see webrev for 7021209). Maybe I should go
back and fix the others....
Odd, seems like mostly duplicate code....
More information about the core-libs-dev