review request for 7022624, convert test to use try-with-resources

Stuart Marks stuart.marks at
Mon Feb 28 22:29:48 UTC 2011

Here's a small webrev with changes to a handful of tests to use TWR.

I have a few minor questions:

* test/java/io/File/

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.

* test/java/io/OutputStreamWriter/

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 
on this.

* test/java/io/PrintStream/

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....

* test/java/io/Serializable/evolution/RenamePackage/install/
* test/java/io/Serializable/evolution/RenamePackage/test/

Odd, seems like mostly duplicate code....



More information about the core-libs-dev mailing list