diff --git a/src/java.base/share/classes/java/nio/file/Files.java b/src/java.base/share/classes/java/nio/file/Files.java index 82ab732aec4..cc35012fa0a 100644 --- a/src/java.base/share/classes/java/nio/file/Files.java +++ b/src/java.base/share/classes/java/nio/file/Files.java @@ -1359,6 +1359,9 @@ public final class Files { * associated with a different provider to this object. * * + * If the {@code ATOMIC_MOVE} option is not specified, then the check + * whether the target file exists and the actual move might not be atomic + * with respect to other filesystem activities. * *
An implementation of this interface may support additional * implementation specific options. @@ -1404,8 +1407,11 @@ public final class Files { * if the array contains a copy option that is not supported * @throws FileAlreadyExistsException * if the target file exists but cannot be replaced because the - * {@code REPLACE_EXISTING} option is not specified (optional - * specific exception) + * {@code REPLACE_EXISTING} option is not specified. + * It may also be thrown when the {@code REPLACE_EXISTING} option + * is specified, the move is not atomic, and the target + * file is created by some other entity at around the same time + * that this method is called * @throws DirectoryNotEmptyException * the {@code REPLACE_EXISTING} option is specified but the file * cannot be replaced because it is a non-empty directory, or the