On Thu, 1 Dec 2022 01:21:13 GMT, Liam Miller-Cushon <cus...@openjdk.org> wrote:
>> test/jdk/tools/jar/ManifestDirectoryCompression.java line 60: >> >>> 58: } >>> 59: Files.delete(dir); >>> 60: } catch (IOException e) { >> >> Have the method throw IOException and you do not need the catch block > > Unfortunately it's recursing on `cleanup` in the lambda, so it can't throw > checked exceptions without more refactoring. This is imitating the recursive > deletion approach in another jar test, I'm happy to swap this out if you'd > prefer a different approach Thanks for the reminder regarding lambada/checked exceptions. I think this can be simplified to just write the jar and test file to the current directory and then just call Files.deleteIfExists(Path.of(JAR_FILE_NAME)); Files.deleteIfExists(Path.of(FILE_NAME)); as they are the only files used by the test . ------------- PR: https://git.openjdk.org/jdk/pull/11441