On Sat, 2 Mar 2024 00:14:22 GMT, Serguei Spitsyn <sspit...@openjdk.org> wrote:
> Q2: Can we use Files.deleteIfExists(path) in the finally block of the run() > method instead? I don't think that changes anything. If run() throws an exception and then Files.deleteIfExists() throws an exception from the finally block, the original exception is lost. > One more approach is to wrap run() call into the runHelper() method: Same issue with potentially losing the original exception. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17992#discussion_r1509758594