HCOLL-167 added JSR166y tests

This commit is contained in:
Rob Austin
2014-10-21 08:21:35 +01:00
parent 46659e0fa0
commit d31bff4d14
4 changed files with 984 additions and 11 deletions
@@ -81,14 +81,18 @@ abstract class AbstractChannelReplicator implements Closeable {
return result;
}
static SocketChannel openSocketChannel(final CloseablesManager closeables) throws IOException {
static SocketChannel openSocketChannel(final CloseablesManager closeables) throws IOException {
SocketChannel result = null;
try {
result = SocketChannel.open();
} finally {
if (result != null)
closeables.add(result);
try {
closeables.add(result);
} catch (IllegalStateException e) {
// already closed
}
}
return result;
}