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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user