8226203: MappedByteBuffer.force method may have no effect on implementation specific map modes
Summary: Fix comment for MappedByteBuffer force methods
Reviewed-by: alanb
--- a/src/java.base/share/classes/java/nio/MappedByteBuffer.java Fri Jun 21 06:33:55 2019 -0700
+++ b/src/java.base/share/classes/java/nio/MappedByteBuffer.java Fri Jun 21 15:16:03 2019 +0100
@@ -235,8 +235,11 @@
* 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>
+ * java.nio.channels.FileChannel.MapMode#READ_WRITE}) then
+ * invoking this method may have no effect. In particular, the
+ * method has no effect for buffers mapped in read-only or private
+ * mapping modes. This method may or may not have an effect for
+ * implementation-specific mapping modes. </p>
*
* @return This buffer
*/
@@ -271,7 +274,10 @@
*
* <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>
+ * invoking this method may have no effect. In particular, the
+ * method has no effect for buffers mapped in read-only or private
+ * mapping modes. This method may or may not have an effect for
+ * implementation-specific mapping modes. </p>
*
* @param index
* The index of the first byte in the buffer region that is