#1412 - Fix Resource leaks for properties & yaml files etc - ManifestReader

Not fixing a leak but just changing to use try with resources
This commit is contained in:
Rob Bygrave
2018-06-11 00:04:58 +12:00
parent 90dfbcd7b3
commit ca7e5b79b8
@@ -59,11 +59,8 @@ class ManifestReader {
try {
Enumeration<URL> resources = classLoader.getResources(resourcePath);
while (resources.hasMoreElements()) {
InputStream is = resources.nextElement().openStream();
try {
try (InputStream is = resources.nextElement().openStream()) {
read(new Manifest(is));
} finally {
close(is);
}
}
} catch (IOException e) {
@@ -72,14 +69,6 @@ class ManifestReader {
return packageSet;
}
private void close(InputStream is) {
try {
is.close();
} catch (IOException e) {
logger.warn("Error closing manifest InputStream", e);
}
}
/**
* Read the entity packages from the manifest.
*/