RFR: 8371689: (fs) CopyMoveHelper.copyToForeignTarget use of sourcePosixView is confusing
Alan Bateman
alanb at openjdk.org
Thu Nov 13 19:36:05 UTC 2025
On Thu, 13 Nov 2025 19:32:50 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> In `CopyMoveHelper`, replace `PosixFileAttributeView` with a `boolean`.
>
> src/java.base/share/classes/java/nio/file/CopyMoveHelper.java line 116:
>
>> 114:
>> 115: // retrieve whether source posix view is supported
>> 116: FileStore fileStore = provider.getFileStore(source);
>
> I'm concerned this will add overhead to each copy operation. There shouldn't be any need to use FileStore in this method. If the provider supports the the POSIX view then this method can use it.
So I think the summary is the JBS issue isn't really a bug, it's more than using sourcePosixView instead of boolean is confusing when looking at this code.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28304#discussion_r2524693092
More information about the nio-dev
mailing list