RFR: 8374222: jpackage will exit with error if it fails to clean the temp directory

Alexander Matveev almatvee at openjdk.org
Wed Feb 18 02:02:57 UTC 2026


On Wed, 11 Feb 2026 04:13:53 GMT, Alexey Semenyuk <asemenyuk at openjdk.org> wrote:

> jpackage will attempt to delete the temp directory a few times. If all attempts fail, it will print remaining files and empty directories (100 entries at most) to the console and continue. It will not exit with an error status as previously, as this is not a critical error.

Changes requested by almatvee (Reviewer).

src/jdk.jpackage/share/classes/jdk/jpackage/internal/TempDirectory.java line 93:

> 91:                             } else {
> 92:                                 // Collect the list of leftover files. Collect at most the first 100 files.
> 93:                                 var remainingFiles = DirectoryListing.listFilesAndEmptyDirectories(path, 100).paths();

I would define 100 as a constant.

test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/TempDirectoryTest.java line 123:

> 121: 
> 122:     @ParameterizedTest
> 123:     @CsvSource({"100", "0"})

Do we need to test other limits like 101 or 1?

test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/TempDirectoryTest.java line 292:

> 290: 
> 291:         boolean isSuccess() {
> 292:             return this ==  SUCCEED;

Extra space.

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

PR Review: https://git.openjdk.org/jdk/pull/29664#pullrequestreview-3817264492
PR Review Comment: https://git.openjdk.org/jdk/pull/29664#discussion_r2819945345
PR Review Comment: https://git.openjdk.org/jdk/pull/29664#discussion_r2819951802
PR Review Comment: https://git.openjdk.org/jdk/pull/29664#discussion_r2819955414


More information about the core-libs-dev mailing list