Close the JarFile
@@ -342,7 +342,7 @@ public class ResolverUtil {
try {
connection = (JarURLConnection) url.openConnection();
if (connection != null) {
- JarFile jarFile = connection.getJarFile();
+ try (JarFile jarFile = connection.getJarFile()) {
Enumeration<JarEntry> entries = jarFile.entries();
while (entries.hasMoreElements()) {
JarEntry entry = entries.nextElement();
@@ -351,6 +351,7 @@ public class ResolverUtil {
addIfMatching(test, name);
}
}
+ }
} else {
LOGGER.error("Could not establish connection to {}", url.toString());
}
