@@ -1531,7 +1531,8 @@ public static FileStore getFileStore(Path path) throws IOException {
1531
1531
* @throws SecurityException
1532
1532
* In the case of the default provider, and a security manager is
1533
1533
* installed, the {@link SecurityManager#checkRead(String) checkRead}
1534
- * method is invoked to check read access to both files.
1534
+ * method is invoked to check read access to both files when the
1535
+ * two paths are not equal
1535
1536
*
1536
1537
* @see java.nio.file.attribute.BasicFileAttributes#fileKey
1537
1538
*/
@@ -1571,6 +1572,9 @@ public static boolean isSameFile(Path path, Path path2) throws IOException {
1571
1572
* and {@code g}, {@code mismatch(f,g)} will return the same value as
1572
1573
* {@code mismatch(g,f)}).
1573
1574
*
1575
+ * <p> If both {@code Path} objects are equal, then this method returns
1576
+ * {@code true} without checking if the file exists.
1577
+ *
1574
1578
* @param path
1575
1579
* the path to the first file
1576
1580
* @param path2
@@ -1583,7 +1587,8 @@ public static boolean isSameFile(Path path, Path path2) throws IOException {
1583
1587
* @throws SecurityException
1584
1588
* In the case of the default provider, and a security manager is
1585
1589
* installed, the {@link SecurityManager#checkRead(String) checkRead}
1586
- * method is invoked to check read access to both files.
1590
+ * method is invoked to check read access to both files when the
1591
+ * two paths are not equal
1587
1592
*
1588
1593
* @since 12
1589
1594
*/
0 commit comments