On Tue, 8 Jun 2021 11:32:29 GMT, Alan Bateman <[email protected]> wrote:

>> jlink should clean up output directory on any failure. should not leave 
>> partially filled output.
>
> src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java line 295:
> 
>> 293:             cleanupOutput(outputPath);
>> 294:             return EXIT_ERROR;
>> 295:         } catch (BadArgs e) {
> 
> Can you confirm that this change is benign for the case that the output 
> directory exists? I believe it's a BadArgs case so it won't attempt to delete 
> a file or tree if it exists but I'd like confirmation.

Will check that.

> src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java line 490:
> 
>> 488: 
>> 489:     private static void deleteDirectory(Path dir) throws IOException {
>> 490:         if (dir != null && Files.isDirectory(dir)) {
> 
> I don't think this method should be checking dir, that should be up to the 
> caller to ensure that it is not called when output is null.

okay. will move that check to caller.

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

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

Reply via email to