On Fri, 14 Jan 2022 12:52:11 GMT, Aleksey Shipilev <sh...@openjdk.org> wrote:
> This is not as trivial, AFAICS. Note that the existing code `delete fs` after > checking `if (os != NULL && os != out)`. Does it mean this patch can > effectively `delete out`? Thanks for looking at this. No, it is safe. `fs` is a temporary fileStream which may or may not be NULL. It is safe to `delete` it. The delete you mention could be moved out of the condition and it would still be fine. The condition is only really needed for the output which should only appear if you don't write to stdout. ------------- PR: https://git.openjdk.java.net/jdk/pull/7078