RFR: 8214248: (fs) Files:mismatch spec clarifications [v2]

Alan Bateman alanb at openjdk.org
Mon Aug 21 16:02:29 UTC 2023


On Mon, 21 Aug 2023 15:35:47 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> Clarify that `Files::mismatch` does not access the file system if both paths locate the same file. Add package documentation about file operations on directories being implementation specific.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8214248: Revise verbiage; revert package file

src/java.base/share/classes/java/nio/file/Files.java line 1574:

> 1572:      * and {@code g}, {@code mismatch(f,g)} will return the same value as
> 1573:      * {@code mismatch(g,f)}). The only case where there is no file system
> 1574:      * access is when the paths are equal.

What would you think of putting this in a new paragraph with "If both Path objects are equal then this method returns true without checking if the file exists"? This would be consistent with isSameFlie?

The updated description for the security exceptions looks okay.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/15350#discussion_r1300318498


More information about the nio-dev mailing list