The choices for the exceptions in NIO were made in JSR 51 and JSR 203,
explanations are possible to promote understanding but the API is fixed.
ClosedFileSstemException extends IllegalStateException to reflect that
after the FileSystem is closed any operations on it or objects previously retrieved
from it are not valid. It reflects a coding error by the developer.
ClosedChannelException and those that extend IOException are intended
to handle normal conditions that occur while processing a particular I/O stream
and reflect conditions that happen more dynamically in the channel.
On 2/27/2013 9:42 AM, Werner Keil wrote:
Following the discussion about NIO, please could we clarify why java.nio.file.ClosedFileSystemException
was intended to be IllegalArgumentException, hence a RuntimeException, while java.nio.channels.ClosedChannelException from NIO (as far back as JDK 1.4) extends IOException?
I understand, ClosedFileSystemException may not be a FileSystemException (which has e.g. getFile() and other methods that no longer make sense in this case) but to be consistent with e.g. ClosedChannelException, it should be an IOException, regardless if that is checked or unchecked (it is checked, but that's historically grown and can't be changed I guess
Thanks and Regards,Werner
On Wed, Feb 27, 2013 at 12:56 PM, < " target="_blank"> > wrote:
many thanks for your comments. Let's talk about it on today's call.
[jsr360-observers] [jsr360-experts] Re: Fwd: Reminder: CLDC 8 / JSR 360 EG call - Conference Bridge