(fc) FileChannel#map should document behavior when using custom file systems

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: None
    • Component/s: core-libs
    • Cause Known
    • 19
    • generic
    • generic

      While reviewing FileChannel#map API after merging the Panama Foreign I noticed some inconsistencies between implementation and documentation:

      The new method returning MemorySegment, which was added to FileChannel class couldn't be made abstract (backwards compatibility). Therefore the default implementation is just throwing UnsupportedOperationException.

      In the documentation it says:
           * @throws UnsupportedOperationException
           * If an unsupported map mode is specified.

      This statement is incomplete, because it also throws this exception when a custom FileSystem implementation returns a FileChannel implementation that does not implement that method.

      For the already existing abstract method, the same statement is given, but I'd suggest to change the spec here, too, so a custom FileSystem implementation that does not support mmap could implement the abstract method also with UnsupportedOperationException. I think jrtfs does this (not checked).

            Assignee:
            Brian Burkhalter
            Reporter:
            Uwe Schindler
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: