On Tue, 13 Apr 2021 21:10:56 GMT, Kevin Rushforth <k...@openjdk.org> wrote:

> Are you sure you need an `AtomicReference` to set the exception? I don't see 
> any use of multiple threads, but I might be missing something. If you do need 
> it, you need to fix the order of arguments.

`postVisitDirectory()` and `visitFile()` methods can be potentially called 
concurrently by `walkFileTree()`. Javadoc 
https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/file/Files.html#walkFileTree(java.nio.file.Path,java.util.Set,int,java.nio.file.FileVisitor)
 doesn't say anything about synchronization, so I think it is fair to assume it 
is not guaranteed.

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

PR: https://git.openjdk.java.net/jdk/pull/3473

Reply via email to