RFR: JDK-8264110 (fs) possible UnsupportedOperationException in UnixUserDefinedFileAttributeView.read(...)
Sebastian Stenzel
github.com+1204330+overheadhunter at openjdk.java.net
Fri Mar 26 15:23:31 UTC 2021
During `write()`, we check whether the `src` buffer exposes a raw byte array:
https://github.com/openjdk/jdk/blob/4e74de4b2eec611b49ee8defae1ab06351280008/src/java.base/unix/classes/sun/nio/fs/UnixUserDefinedFileAttributeView.java#L247-L258
The same is now also done during `read()`. This should allow using arbitrary ByteBuffer implementations as `dst` and restores a certain symmetry between read and write.
-------------
Commit messages:
- use tmp array, if buffer doesn't have an array
Changes: https://git.openjdk.java.net/jdk/pull/3217/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3217&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8264110
Stats: 11 lines in 1 file changed: 7 ins; 0 del; 4 mod
Patch: https://git.openjdk.java.net/jdk/pull/3217.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/3217/head:pull/3217
PR: https://git.openjdk.java.net/jdk/pull/3217
More information about the nio-dev
mailing list