RFR: 6980847: (fs) Files.copy needs to be tuned [v3]

Brian Burkhalter bpb at openjdk.java.net
Wed Jun 15 17:52:15 UTC 2022


On Wed, 15 Jun 2022 12:17:26 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   6980847: Remove unnecessary catch of SecurityException and UnsupportedOperationException which are not thrown by blockSize()
>
> src/java.base/unix/classes/sun/nio/fs/UnixCopyFile.java line 276:
> 
>> 274:                     long bss = Files.getFileStore(source).getBlockSize();
>> 275:                     long bst = Files.getFileStore(target).getBlockSize();
>> 276:                     if (bss > 0 && bst > 0) {
> 
> This should be UnixFileStoreAttributes.get(source).blockSize() to avoid calling from the provider to the API or needing to create a FileStore.

Fixed in bc4096c6cd4f1a060a8cacb154ac090c98f94aa3.

-------------

PR: https://git.openjdk.org/jdk/pull/9161


More information about the nio-dev mailing list