[9] RFR: 8164166: Make sure java/nio/channels tests shutdown asynchronous channel groups
Alan Bateman
Alan.Bateman at oracle.com
Tue Aug 23 09:50:53 UTC 2016
On 23/08/2016 01:28, Artem Smotrakov wrote:
> :
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8164166
> Webrev: http://cr.openjdk.java.net/~asmotrak/8164166/webrev.00/
For test/java/nio/channels/AsynchronousChannelGroup/Basic.java then it
would be a lot cleaner to put the cleanup in shutdownTests, e.g.:
AsynchronousChannelGroup group = ...
try {
testShutdownWithNoChannels(pool, group);
} finally {
group.shutdown();
}
In GroupOfOne then L47-49 isn't early to read. If you move the bind into
the try-finally, as in: listener.bind(new InetSocketAddress(0))) then it
would be a bit easier. Same comment for the changes to Identify and
testRestart in Restart.java.
In testRestart then it looks like the try is in the wrong place, I
assume you want:
group = ...
try {
testRestart(...)
} finally {
group.shutdown();
}
-Alan
More information about the nio-dev
mailing list