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

(bf) MappedByteBuffer should clarify copying between overlapping mappings

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Withdrawn
    • Icon: P4 P4
    • 15
    • core-libs
    • None
    • behavioral
    • minimal
    • Verbiage added to clarify existing behavior.
    • Java API

      Summary

      MappedByteBuffer does not specify that bulk copying between overlapping mapped regions of the same file has unspecified results.

      Problem

      If two MappedByteBuffers are created from overlapping ranges of the same file and a bulk copy is performed between them, then surprising and unexpected results may occur.

      Solution

      Add verbiage stating that that bulk copying between MappedByteBuffers mapped from overlapping ranges of the same file has unspecified results.

      Specification

      Add this sentence before the current last sentence of the class level specification of MappedByteBuffer:

      The result of a bulk copy between two {@code MappedByteBuffer}s is unspecified if they are mapped from overlapping regions of the same file.

      A webrev is attached.

            bpb Brian Burkhalter
            bpb Brian Burkhalter
            Paul Sandoz, Roger Riggs
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: