Summary
Add an @implSpec
annotation to the method
java.nio.channels.FileChannel.map(FileChannel.MapMode,long,long,MemorySession)
for creating mapped memory segments indicating that it always throw an UnsupportedOperationException
.
Problem
FileChannel.map()
for mapped memory segments always throws UnsupportedOperationException
but this is not explicitly stated.
Solution
Add an @implSpec
annotation to the method which states that an UnsupportedOperationException
is always thrown.
Specification
--- a/src/java.base/share/classes/java/nio/channels/FileChannel.java
+++ b/src/java.base/share/classes/java/nio/channels/FileChannel.java
@@ -997,6 +997,9 @@ public abstract class FileChannel
* of mapped memory associated with the returned mapped memory
* segment is unspecified and should not be relied upon.
*
+ * @implSpec The default implementation of this method throws
+ * {@code UnsupportedOperationException}.
+ *
* @param mode
* The file mapping mode, see
* {@link FileChannel#map(FileChannel.MapMode, long, long)};
- csr of
-
JDK-8288080 (fc) FileChannel::map for MemorySegments should state it always throws UOE
-
- Resolved
-