Minor, use "use" to automatically close JarFile

JarFile extends Closeable on JDK 8, so we can use "use" here now
This commit is contained in:
Alexander Udalov
2017-03-29 17:28:18 +03:00
parent cbc893ed17
commit 3b8110f51c
5 changed files with 5 additions and 29 deletions
@@ -69,13 +69,9 @@ object LibraryUtils {
if (!library.canRead()) return null
try {
val jarFile = JarFile(library)
try {
JarFile(library).use { jarFile ->
return jarFile.manifest
}
finally {
jarFile.close()
}
}
catch (ignored: IOException) {
return null