Depending on the used ByteBuffer implementation, `read(...)` might fail with an UnsupportedOperationException.
The `write(...)` method checks whether the ByteBuffer has an array from which it can copy the data that should get written: https://github.com/openjdk/jdk/blob/45e1bab87ccebd498d4f927a008dd89a47dd177b/src/java.base/unix/classes/sun/nio/fs/UnixUserDefinedFileAttributeView.java#L240-L251
However, during `read(...)` an unchecked call to `dst.array()` in https://github.com/openjdk/jdk/blob/45e1bab87ccebd498d4f927a008dd89a47dd177b/src/java.base/unix/classes/sun/nio/fs/UnixUserDefinedFileAttributeView.java#L203 might cause an UnsupportedOperationException to be thrown, if `dst` is not backed by an array.
The `write(...)` method checks whether the ByteBuffer has an array from which it can copy the data that should get written: https://github.com/openjdk/jdk/blob/45e1bab87ccebd498d4f927a008dd89a47dd177b/src/java.base/unix/classes/sun/nio/fs/UnixUserDefinedFileAttributeView.java#L240-L251
However, during `read(...)` an unchecked call to `dst.array()` in https://github.com/openjdk/jdk/blob/45e1bab87ccebd498d4f927a008dd89a47dd177b/src/java.base/unix/classes/sun/nio/fs/UnixUserDefinedFileAttributeView.java#L203 might cause an UnsupportedOperationException to be thrown, if `dst` is not backed by an array.
- blocks
-
JDK-8264112 (fs) Reorder methods/constructor/fields in UnixUserDefinedFileAttributeView.java
-
- Resolved
-
- relates to
-
JDK-8264341 (fs) Remove dead code from UnixUserDefinedFileAttributeView.write(...)
-
- Closed
-
- links to
-
Review openjdk/jdk/3217