Skip to content

JarFileArchive creates a JarFile that is never closed #17126

@wilkinsona

Description

@wilkinsona

When a JarFileArchive is created with a File, it creates a JarFile instance that is never closed. There's no accessor for the underlying JarFile and no close() method so, without resorting to reflection, there's nothing that a user of JarFileArchive can do to avoid leaking an open file.

This problem affects our tests where the open files prevent JUnit 5 from cleaning up a temporary directory. We could resort to reflection in our tests to close the underlying JarFile, but we may want to fix it more "properly" which I think will require changes to public API.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions