Skip to content

Commit

Permalink
Code optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
smallyao committed May 27, 2024
1 parent 27449c3 commit 05105b2
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
*/
package org.apache.streampark.common.util

import org.apache.streampark.common.util.ImplicitsUtils.AutoCloseImplicits

import org.apache.commons.lang3.StringUtils

import java.io._
Expand Down Expand Up @@ -71,14 +73,8 @@ object Utils extends Logger {

def getJarManifest(jarFile: File): jar.Manifest = {
requireCheckJarFile(jarFile.toURL)
var jarInputStream: JarInputStream = null;
try {
jarInputStream = new JarInputStream(new BufferedInputStream(new FileInputStream(jarFile)))
jarInputStream.getManifest
} finally {
if (jarInputStream != null)
jarInputStream.close
}
new JarInputStream(new BufferedInputStream(new FileInputStream(jarFile)))
.autoClose(_.getManifest)
}

def getJarManClass(jarFile: File): String = {
Expand Down

0 comments on commit 05105b2

Please sign in to comment.