Name: bsC130419 Date: 06/13/2001
JDK 1.4.0Beta. Precise information not relevant because this is a design issue.
Thread.interrupt closes channels - why?
The motivation for the ClosedByInterruptException feature is obscure.
Previously, when a thread doing any I/O is interrupted, it would incur an
InterruptedIOException. I can't see the justification for changing this
semantic in the case of java.nio Channels and I can't see any justification for
the channel being closed. The read or write or select should be interrupted but
unless there is some major hidden implementation issue there is no apparent
reason to interfere with the integrity of the channel.
Or does it have to do with maintaining the channel state accurately? If so I
think this should be stated, as the whole feature is counter-intuitive and
needs justification.
(Review ID: 126429)
======================================================================