RFR: 8263742: (bf) MappedByteBuffer.force() should use the capacity as its upper bound

Brian Burkhalter bpb at openjdk.java.net
Wed Mar 17 17:00:00 UTC 2021


Prior to JDK 15, the method `java.nio.MappedByteBuffer.force()` wrote back the entire contents of the buffer, i.e., the half-open range `[0,capacity())`. In JDK 15 the upper bound of the write-back changed from `capacity()` to `limit()`. The change was inadvertent through a chain of fixes outlined in the description of the associated issue. This request is to change back to the previous behavior and use the capacity instead of the limit as the upper bound of the write-back.

-------------

Commit messages:
 - 8263742: (bf) MappedByteBuffer.force() should use the capacity as its upper bound

Changes: https://git.openjdk.java.net/jdk/pull/3052/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3052&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8263742
  Stats: 8 lines in 1 file changed: 0 ins; 0 del; 8 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3052.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3052/head:pull/3052

PR: https://git.openjdk.java.net/jdk/pull/3052


More information about the nio-dev mailing list