mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#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:
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user