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 0d9bba9cbca..3c359495012 100644 --- a/src/java.base/share/classes/java/nio/file/Files.java +++ b/src/java.base/share/classes/java/nio/file/Files.java @@ -1219,10 +1219,9 @@ public final class Files { * * * {@link StandardCopyOption#REPLACE_EXISTING REPLACE_EXISTING} - * If the target file exists, then the target file is replaced if it - * is not a non-empty directory. If the target file exists and is a - * symbolic link, then the symbolic link itself, not the target of - * the link, is replaced. + * Replace an existing file. A non-empty directory cannot be + * replaced. If the target file exists and is a symbolic link, then the + * symbolic link itself, not the target of the link, is replaced. * * * {@link StandardCopyOption#COPY_ATTRIBUTES COPY_ATTRIBUTES} @@ -1342,10 +1341,9 @@ public final class Files { * * * {@link StandardCopyOption#REPLACE_EXISTING REPLACE_EXISTING} - * If the target file exists, then the target file is replaced if it - * is not a non-empty directory. If the target file exists and is a - * symbolic link, then the symbolic link itself, not the target of - * the link, is replaced. + * Replace an existing file. A non-empty directory cannot be + * replaced. If the target file exists and is a symbolic link, then the + * symbolic link itself, not the target of the link, is replaced. * * * {@link StandardCopyOption#ATOMIC_MOVE ATOMIC_MOVE}