RFR: 8321561: (fs) Clarify non-atomic behavior of Files.move [v2]
Alan Bateman
alanb at openjdk.org
Fri Jan 12 11:44:22 UTC 2024
On Thu, 11 Jan 2024 19:15:41 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:
>> Make it clear that a `FileAlreadyExistsException` may be thrown by `Files.move` even if the `REPLACE_EXISTING` option is specified.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
>
> 8321561: Update verbiage instead of adding API note
src/java.base/share/classes/java/nio/file/Files.java line 1363:
> 1361: * If the {@code ATOMIC_MOVE} option is not specified, then the check for
> 1362: * an existing file and the actual move might not be atomic with respect
> 1363: * to other filesystem activities.
This looks quite good. A small suggestion is to replace "the check for an existing file" with "the check if the target file exists". The reason is that the other sentences use the phrase "target file exists" a few times.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17061#discussion_r1450293699
More information about the nio-dev
mailing list