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

Andy Herrick herrick at openjdk.java.net
Tue Apr 13 20:35:58 UTC 2021

On Tue, 13 Apr 2021 20:26:56 GMT, Andy Herrick <herrick at openjdk.org> wrote:

>> src/jdk.jpackage/share/classes/jdk/jpackage/internal/IOUtils.java line 59:
>>> 57: 
>>> 58:     public static void deleteRecursive(Path directory) throws IOException {
>>> 59:         final IOException [] exception = { (IOException) null };
>> Do we know `Files.walkFileTree()` synchronizes calls on callback object? If not, I'd use `AtomicReference` to store the first exception.
> That seems like overkill.  walkFileTree must call visitFile, preVisitDirectory, and postVisitDirectory synchronously, because their return value tells walkFileTree where to go next.

I can use AtomicReference instead of Array to hold the IOException, but must I lock around access, there is no "setIfNull()" method


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

More information about the core-libs-dev mailing list