RFR: JDK-8265078: jpackage tests on Windows leave large temp files [v2]

Kevin Rushforth kcr at openjdk.java.net
Wed Apr 14 18:03:36 UTC 2021


On Wed, 14 Apr 2021 17:36:21 GMT, Alexey Semenyuk <asemenyuk at openjdk.org> wrote:

> postVisitDirectory() and visitFile() methods can be potentially called concurrently by walkFileTree()

I don't think they can.

> Javadoc ... doesn't say anything about synchronization, so I think it is fair to assume it is not guaranteed.

Given that the `Files` class says nothing about running its various file walking operations in parallel, I think you can be confident that the visitor methods are only ever run on the same thread that calls walkFileTree. I would consider it a bug if the thread used to callback into the visitor were different from the calling thread.

Still, I think using `AtomicReference` is fine here, so this is a moot point for this PR.

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

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


More information about the core-libs-dev mailing list