RFR: 8240349: jlink --vm with not present VM does not fail fast
Athijegannathan Sundararajan
sundar at openjdk.java.net
Tue Jun 8 13:05:16 UTC 2021
On Tue, 8 Jun 2021 11:32:29 GMT, Alan Bateman <alanb at openjdk.org> 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
More information about the core-libs-dev
mailing list