RFR: 8114830: (fs) Files.copy fails due to interference from something else changing the file system [v5]
Alan Bateman
alanb at openjdk.org
Sat Aug 5 10:46:44 UTC 2023
On Fri, 4 Aug 2023 17:41:35 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:
>> Throw a `FileSystemException` if attempting to create the target file with `O_EXCL` fails with `EEXIST`.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
>
> 8114830: In test, use try-with-resources to closs to close ExecutorService
test/jdk/java/nio/file/Files/CopyInterference.java line 86:
> 84: throw new RuntimeException("Unexpected exception", e);
> 85: }
> 86: running.set(false);
It might be better to use a finally block to set running to false.
CopyTask fields can be final too.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15141#discussion_r1285019303
More information about the nio-dev
mailing list