RFR: 8327046: (fs) Files.walk should be clear that depth-first traversal is pre-order [v2]

Alan Bateman alanb at openjdk.org
Thu Feb 29 13:48:54 UTC 2024


On Thu, 29 Feb 2024 13:06:04 GMT, Pavel Rappo <prappo at openjdk.org> wrote:

>> Please review this clarification to the specification of the two overloads of `java.nio.file.Files.walk`. No tests are added, as I believe the existing `StreamTest.testWalk*` methods already test the order sufficiently. I also took this opportunity to fix a few minor typos.
>
> Pavel Rappo has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Oops.

Your proposed wording is okay but it makes me wonder if we now need to define "pre-order" as it is new term here. An alternative is something like this:

"The file tree traversal is depth-first with a directory visited before the entries in the directory."

which will align it closely to the existing wording in walkFileTree and FileVisitor.

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

PR Comment: https://git.openjdk.org/jdk/pull/18063#issuecomment-1971181170


More information about the nio-dev mailing list