Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7132279

(ch) SeekableByteChannel operation may throw Non{Readable,Writable}ChannelException

XMLWordPrintable

    • b24
    • x86
    • windows_7

      A DESCRIPTION OF THE REQUEST :
      SeekableByteChannel implements ReadableByteChannel and WritableByteChannel but fails to mention that its read() and write() methods may throw NonReadableChannelException and NonWritableChannelException, respectively.

      The default Filesystem implementation uses this fact. If you open a Path in read-only mode using Files.newByteChannel() and then try writing to it you will get NonWritableChannelException.

      JUSTIFICATION :
      The subclass Javadoc should document all possible exceptions that may be thrown because readers are liable to miss the fact that the super-interfaces mention more exceptions.

            bpb Brian Burkhalter
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: