RFR: JDK-8264110 (fs) possible UnsupportedOperationException in UnixUserDefinedFileAttributeView.read(...)
Alan Bateman
alanb at openjdk.java.net
Sun Mar 28 15:26:34 UTC 2021
On Sat, 27 Mar 2021 21:48:49 GMT, Sebastian Stenzel <github.com+1204330+overheadhunter at openjdk.org> wrote:
>> Buffers are closed abstraction and cannot be implemented outside of the java.nio package. When sealed classes are promoted from preview to be a permanent feature then maybe we should look at make them sealed. For now, I think the only scenario where the reported issue can arise is when someone injects their own class into java.nio, maybe a mock as you suggest. I'm not opposed to handling such cases but I suspect it would require work in several other areas of the JDK that currently have to distinguish between heap and direct buffers.
>>
>> As regards tests, then yes, the basic unit test for UserDefinedAttributeView is an old style jtreg test. It pre-dates support for TestNG and other frameworks.
>
> If we can be sure that the buffers are either direct or have an array, I suggest we close this PR unresolved, change the write method and add a corresponding assertion to both methods.
Closing this PR/issue and drop the code from write sounds good.
-------------
PR: https://git.openjdk.java.net/jdk/pull/3217
More information about the nio-dev
mailing list