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

(bf) MappedByteBuffer.force method may have no effect on implementation specific map modes

    XMLWordPrintable

Details

    • CSR
    • Resolution: Approved
    • P3
    • 13
    • core-libs
    • None
    • source
    • minimal
    • There is no significant risk as this merely updates the javadoc to be more accurate
    • Java API
    • SE

    Description

      Summary

      Update MappedByteBuffer.force javadoc to encompass implementtaion-specific map modes

      Problem

      JDK-8221397 allowed for a MappedByteBuffer to be mapped using an implementation-specific map mode. The javadoc for force was not updated to explain that a request may complete with no effect in such a case.

      Solution

      Update the javadoc to include this outcome.

      Specification

      @@ -232,13 +232,13 @@
            * invoked, will have been written to that device.
            *
            * <p> If the file does not reside on a local device then no such guarantee
            * is made.
            *
      -     * <p> If this buffer was not mapped in read/write mode ({@link
      -     * java.nio.channels.FileChannel.MapMode#READ_WRITE}) then invoking this
      -     * method has no effect. </p>
      +     * <p> This method has no effect for buffers mapped in read-only
      +     * or private mapping modes. It may also have no effect for other
      +     * implementation specific map modes. </p>
            *
            * @return  This buffer
            */
           public final MappedByteBuffer force() {
               if (fd == null) {
      
      @@ -267,13 +267,13 @@
            * are transferred in their entirety.
            *
            * <p> If the file does not reside on a local device then no such
            * guarantee is made.
            *
      -     * <p> If this buffer was not mapped in read/write mode ({@link
      -     * java.nio.channels.FileChannel.MapMode#READ_WRITE}) then
      -     * invoking this method has no effect. </p>
      +     * <p> This method has no effect for buffers mapped in read-only
      +     * or private mapping modes. It may also have no effect for other
      +     * implementation specific map modes. </p>
            *
            * @param index
            *        The index of the first byte in the buffer region that is
            *        to be written back to storage; must be non-negative
            *        and less than limit()

      Attachments

        Issue Links

          Activity

            People

              adinn Andrew Dinn
              alanb Alan Bateman
              Alan Bateman
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: