Skip to content

Resource leak for maven plugin used with java eclipse formatter #447

@pzygielo

Description

@pzygielo

Resource leak for maven plugin used with java eclipse formatter


After check goal of spotless maven plugin (1.24.1) configured to use java > eclipse, temporary directory is left in filesystem.

Seems that below deleteOnExit

private static URL createTemporaryDirectory() {
try {
Path locationPath = Files.createTempDirectory(TEMP_PREFIX);
locationPath.toFile().deleteOnExit();
return locationPath.toUri().toURL();
} catch (IOException e) {
throw new IOError(e);
}

is not enough, as directory is non-empty (contains subdirectory org.eclipse.core.runtime), and as such is not deleted on JVM exit.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions