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.
- csr of
-
JDK-8242477 (bf) MappedByteBuffer should clarify copying between overlapping mappings
- Closed
- relates to
-
JDK-8246282 [REDO] JDK-8245121 (bf) XBuffer.put(Xbuffer src) can give unexpected result when storage overlaps
- Resolved
-
JDK-8245866 (bf) XBuffer.put(Xbuffer src) can give unexpected result when storage overlaps
- Closed